Program for example of static variable - 100 Most Important C# Programs

98. Program for example of static variable.

Code:

#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;

}