#include void useGlobal( void ); void useLocal( void ); int x = 1; /* global variable */ int main( void ) { int x = 5; printf("x on entering main is %d\n", x); {/* start new scope */ int x = 7; /*local variable to new scope */ printf("x in inner scope of main is %d\n", x); }/* end new scope */ printf("x in outer scope of main is %d\n", x); useLocal(); useGlobal(); useLocal(); useGlobal(); printf("\nx on exiting main is %d\n", x); return 0; } void useLocal(void) { int x = 25; printf("\n x is %d on entering useLocal\n", x); x++; printf(" x is %d on exiting useLocal\n", x); } void useGlobal(void) { printf("\n x is %d on entering useGlobal.\n", x); x *= 10; printf(" x is %d on exiting useGlobal.\n", x); }