C - Data Types - Discussion
You Are Here :: Home > C > Data Types - Discussion
#include int main(){ int i; for(i=0;i<4;i++){ int a=20; printf("%d",a); a++; } return 0; }
Variable declared inside the for loop block has scope only within that block. After the first iteration variable a becomes dead and it looses its incremented value. In second iteration variable a is again declared and initialized and so on.
Discussion