Кто-то мне обьяснит зачем придумали 3 цикла, если можно пользоваться только одним (for) ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Кто-то мне обьяснит зачем придумали 3 цикла, если можно пользоваться только одним (for) ?

public class Program { public static void main(String[] args) { int x = 1; do { System.out.println("x = " + x); x++; } while(x < 5); for(int o = 1; o < 5; o++) { System.out.println("o =" + o) ; } int p = 1; while (p < 5) { System.out.println("p = " + p); p++; } } }

14th May 2018, 2:22 PM
Mika Hatsune
Mika Hatsune - avatar
1 Answer
+ 2
i did not get what you try to say.. but look to your program it work fine
15th May 2018, 3:00 PM
Arun Tomar
Arun Tomar - avatar