0

java

Arrange the code to produce a valid finite loop which prints a text to the screen in the loop : while(x<100){ System.out.println("Java Rocks!") x++;} int x=12; answer please

7th Jul 2018, 7:38 AM
sara92 92
sara92 92 - avatar
3 Réponses
+ 1
Take int x = 12; to the top and it will be correct
7th Jul 2018, 7:39 AM
Sad
Sad - avatar
+ 1
You have to first declare x variable so while loop can check condition. That is why int x = 12; should be on top
7th Jul 2018, 7:41 AM
Sad
Sad - avatar
+ 1
okay thanks
7th Jul 2018, 8:04 AM
sara92 92
sara92 92 - avatar