+ 8
Why infinite output ????
My question is in the link below!! Please explain 🙏 https://www.sololearn.com/post/444210/?ref=app
3 ответов
+ 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
+ 3
Got it 👍Proলয় मिश्ra (chotu 👩💻)😃
+ 3
Good to know that you got it😊