Program to show the use of static variables in C Language

Program to show the use of static variables in C Language



#include
#incl.ude
void stat();
void main()
{
int c;
clrscr();
for(c=1;c<=3;c++)
stat();
getch();
}

void stat()
{
static int sv=0;
sv=sv+1;
printf("%d\n",sv);
}


No comments:

Post a Comment