Why infinite output ???? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 8

Why infinite output ????

My question is in the link below!! Please explain šŸ™ https://www.sololearn.com/post/444210/?ref=app

20th Jun 2020, 4:35 AM
Reca Resu
Reca Resu - avatar
3 Respostas
+ 4
It's same as: for(int i=0;i<5;){ System.out.print(i); } Because there is not any increment statement in the for loop, the i inside the for loop remains 0 forever(if you know about behavior of post-increment in assignments, then you will understand what i meant), which makes the for loop's condition true forever that's why it prints infinite 0's
20th Jun 2020, 5:02 AM
Bot
Bot - avatar
+ 3
Got it šŸ‘Proą¦²ą¦Æą¦¼ ą¤®ą¤æą¤¶ą„ra (chotu šŸ‘©ā€šŸ’»)šŸ˜ƒ
20th Jun 2020, 5:04 AM
Reca Resu
Reca Resu - avatar
+ 3
Good to know that you got itšŸ˜Š
20th Jun 2020, 5:15 AM
Bot
Bot - avatar