Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

. v2

OpenStudy (anonymous):

``` public class LoopTest { public static void main(String[] args) { for (int i = 0; i < 100; i++) { System.out.println("i = " + Integer.toString(i)); } } } ``` Try this.

OpenStudy (anonymous):

Nice lol

OpenStudy (anonymous):

Are you doing this as well @tanya123

OpenStudy (anonymous):

http://puu.sh/9NCOE/32cdd16561.png

OpenStudy (anonymous):

public class LoopTest { public static void main(String[] args) { for (int i = 0; i < 100; i++) { if (i % 3 == 0) { System.out.println(Integer.toString(i) + " is divisible by 3"); } else { System.out.println(Integer.toString(i) + " is not divisible by 3"); } } } }

OpenStudy (tanya123):

Nope, I couldn't open it...

OpenStudy (anonymous):

lol That's neat @wio

OpenStudy (anonymous):

Do you know what % is?

OpenStudy (anonymous):

Other than percent, I don't think so lol.

OpenStudy (anonymous):

``` public class LoopTest { public static void main(String[] args) { for (int i = 0; i < 100; i++) { System.out.println(Integer.toString(i) + " % 3 is " + Integer.toString(i % 3)); } } } ```

OpenStudy (kainui):

@wio why not just: ``` public class LoopTest { public static void main(String[] args) { for (int i = 0; i < 100; i++) { System.out.println("i = " + i); } } }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!