Define and use global variable and function
#include <stdio.h>
int i =0; //Global variable
void f1(void) {
int k; // local variable for f1.
i = 50;
}
main() {
int j; // local variable in main
f1();
i =0;
printf(" i in main %d\n",i);
f1();
printf(" i after call%d\n",i);
}
Related examples in the same category