Problem 98. C Program for example of static variable.
#include<conio.h>
#include<stdio.h>
static int i=1;
main( )
{
int j;
clrscr( );
for (j=1;j<=5;j++);
fun( );
getch( );
}
fun( ){
printf(“n%d”,i);
i=i+1;
}
C compiler: gcc 4.1.2
#include<conio.h>
#include<stdio.h>
static int i=1;
main( )
{
int j;
clrscr( );
for (j=1;j<=5;j++);
fun( );
getch( );
}
fun( ){
printf(“n%d”,i);
i=i+1;
}
C compiler: gcc 4.1.2
