+ 1

Can someone please explain the result of this C# loop?

https://code.sololearn.com/cV5rPgbp0kKH/?ref=app

7th Feb 2018, 11:02 AM
PinkBunny
PinkBunny - avatar
2 Answers
+ 22
int i; for (i = 3; i <=9; i++) { /*after 7th iteration(9 <=9 ... true ) , i++ is 9++ & then conditon becomes false as 10 is not <=9*/ } Console.Write(5 * i); //5*10
7th Feb 2018, 11:18 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
Thank you!!!
7th Feb 2018, 11:27 AM
PinkBunny
PinkBunny - avatar