Answer to Question #324721 in Java | JSP | JSF for Holly

Question #324721

There was a Three

by CodeChum Admin

I'm bored with just basic counting. How about we do some complex things this time? But I don't want to be associated with any number that's not divisible by 3.


Think you can handle this?


Instructions:

  1. Print out all numbers from 1 to 100 that is divisible by 3, each in separate lines, using a for() loop.

Instructions

  1. Print out all numbers from 1 to 100 that is divisible by 3, each in separate lines, using a for loop.

Output

Multiple lines containing an integer that is divisible by 3.

3
6
9
12
15
18
21
24
27
30
33
36
39
42
45
48
51
54
57
60
63
66
69
72
75
78
81
84
87
90
93
96
99
1
Expert's answer
2022-04-08T16:06:15-0400


class App {
    public static void main(String[] args) {
        for(int i=1;i<100;i++){
            if(i%3==0){
                System.out.println(i);
            }    
        }
         
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS