/* An example of local variable. */ #include int main(void) { int x = 10; if (x == 10) { int x = 99; //this x hides the outer x printf("Inner x: %d\n", x); } printf("Outer x: %d\n", x); return 0; } /* Note: 1. A local variable is CREATED upon entry into its block and DESTROYED upon exit. 2. Can be used only by statements that are INSIDE the block in which the variables are declared. */