C examples for Function:Global Variable
Using a global and duplicate variable in main
#include <stdio.h> int var = 99;// ww w . ja v a 2 s .c o m void print_func(void); int main( void ) { int var = 77; printf( "\nThe Value of var is %d", var ); print_func( ); return 0; } void print_func( void ) { printf( "\nPrinting in function only global:"); printf( "\nThe value of var is %d\n", var ); }