Java Loop exercise: output of a number that cannot be divisible by 3 in a 100--200, with every four line output

Source: Internet
Author: User

Package com.eduask.circulationdemo;/* * * 1. Output of 100--200 that cannot be divisible by 3, Output */public class TestDemo01 {public static void m per four newline Ain (string[] args) {int j = 0;for (int i=100; i<=200; i++) {if (i%3! = 0) {j + +; System.out.print (i+ ""); if (j%4 = = 0) {System.out.print (' \ n ');}}}}

Operation Result:

100  101  103  104  106  107  109  110   112  113  115  116  118  119  121   122  124  125  127  128  130  131   133  134  136  137  139  140  142   143  145  146  148  149  151  152   154  155  157  158  160  161  163   164  166  167  169  170  172  173   175  176  178  179  181  182  184   185  187  188  190  191  193  194   196  197  199  200 


Java Loop exercise: output of a number that cannot be divisible by 3 in a 100--200, with every four line output

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.