C Programming Code Examples C > Functions Code Examples Define local variable for a function Define local variable for a function int j =0; //Global variable void f(void); main() { int j ; // local variable for main j =0; printf("value of j in main %d\n",j); f(); printf("value of j after call%d\n",j); } void f(void) { int j=0; //local variable for f j = 50; }