#include <stdio.h>
int main()
{
void show(void);
printf("\n First Call of show()");
show();
printf("\n Second Call of show()");
show();
printf("\n Third Call of show()");
show();
return 0;
}
void show(void)
{
static int i;
printf("\n i=%d",i);
i++;
}
First Call of show()
i=0
Second Call of show()
i=1
Third Call of show()
i=2
First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.
Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.