Illustration of static variable.
void stat(void); main ( ) { int i; for(i=1; i<=3; i++) stat( ); } void stat(void) { staticint x = 0; x = x+1; printf("x = %d\n", x); } Output x = 1 x = 2 x = 3