+ 5
What is the output of c from the below program?
for(c=10;c<10;c++){} cout<<c
3 Answers
+ 1
10, for the simple fact that the for loop doesn't execute at all since c is not actually less than 10 in the first place. Hence c is equal to the initial value, 10.
+ 1
obviously 10.... because 10<10 is false so it comes out of loop and prints 10 ....
For better understanding of for loop click here https://www.learnbix.com/c-statements/for-loop