how the output is coming describe it

#include<iostream.h>
int main()
{
int c=0;
for(;c++;cout<<c)
if(c==5)
break;
cout<<c;
return 0;
}

@kingvivek30 .From where did this variable c come. Shouldn’t it be ‘i’.

1 Like

In the first For Loop i++ has a value 0. Hence it simply exits the loop. But now as the value of i has changed to 1. It prints the value 1 outside the loop at the cout statement.

plzz declare c and its value …what ever it is ?

//