Loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Loop

Print the values of x variable 5times If intx=1 x<=___

22nd Jun 2019, 6:16 AM
Shah Faisal
Shah Faisal - avatar
2 Answers
+ 2
An if statement only executes once. Your code is nonsensical, because you can't just have 2 expressions next to each other
22nd Jun 2019, 6:26 AM
Airree
Airree - avatar
0
for(int x = 1; x <= 5; x++){ System.out.println(x); }
22nd Jun 2019, 2:43 PM
Denise Roßberg
Denise Roßberg - avatar