- 1

what will be the output of :

for(int x =1; x<=5;x++){ System.out.println (x); }

15th May 2021, 4:36 PM
nightwing
nightwing - avatar
5 Answers
+ 2
Why don't you just try it out in the code playground?
15th May 2021, 4:43 PM
Hape
Hape - avatar
0
Just wanna confirm the output coz i am a beginner
15th May 2021, 4:39 PM
nightwing
nightwing - avatar
0
it would probably be 1 2 3 4 5
15th May 2021, 4:39 PM
nightwing
nightwing - avatar
0
I'd recomend you to try it yourself in the code playground, you'll be able to play with different values and learn from it. And yes you are right, it would print from 1 to 5. Have fun coding :)
15th May 2021, 4:44 PM
Apollo-Roboto
Apollo-Roboto - avatar
0
thanks
15th May 2021, 4:45 PM
nightwing
nightwing - avatar