0

Can you explain this

Int =i for(i=0;i<10,i+=10) System.out.println(i)

15th Jul 2020, 8:08 PM
Pratik Shinde
Pratik Shinde - avatar
8 Answers
+ 5
The semicolon!!!
16th Jul 2020, 8:20 AM
Mantafounis Panagiotis
Mantafounis Panagiotis - avatar
+ 1
There is a semi colon, you may missing int i; for(i=0;i<10,i+=5); //semi colon after System.out.println(i); Output : 10 int i; for(i=0;i<10,i+=5) //no semi colon after System.out.println(i); Output : 0 5 println prints next output in new line.. print continue in same line.. then 05
15th Jul 2020, 8:53 PM
Jayakrishna 🇼🇳
0
But if i+=5 then output?
15th Jul 2020, 8:24 PM
Pratik Shinde
Pratik Shinde - avatar
0
But in sololearn challenge they answering me 10
15th Jul 2020, 8:33 PM
Pratik Shinde
Pratik Shinde - avatar
0
codemonkey plz read above and i had written it println actually its print only so 05
15th Jul 2020, 8:37 PM
Pratik Shinde
Pratik Shinde - avatar
0
Thanks man
15th Jul 2020, 8:44 PM
Pratik Shinde
Pratik Shinde - avatar
0
Jayakrishna🇼🇳i got it i missed it thats make a lot difference
15th Jul 2020, 8:57 PM
Pratik Shinde
Pratik Shinde - avatar
0
It's only print 0 then loop is terminated
16th Jul 2020, 1:43 PM
Jahanzaib Shahid
Jahanzaib Shahid - avatar