Introduction
In C, you can define the counter in the for loop itself; the counter has scope up to the end of the for loop.
Program
#includemain() { int k = 10; } for(int i=0;i<2;i++)\\ A { \\ B printf("value of i is %d\n",i); \\ C } \\ D { printf("the value of i is %d\n",i); \\ E }
Explanation
Point to Remember
You can define counter variable inside the for loop.
No comments:
Post a Comment