+ 2
How the value of count is 11
2 Answers
+ 1
the syntax is wrong for the second for loop and i<=10 means it will go till ten then when it goes inside the loop with 10 it count++ increments So 10 becomes 11
+ 1
Your both loops are altering same loop variable (*i*), so by the end of the first loop, the value of *i* is 11 already, and then program also goes out of outer loop also.