Static Variable
A static variable initialize by 0 instead of garbage at the
time of declaration. Static variable retain its value in memory till the
program is running.
On the other hand auto variable lost its data when function scope pass out . But static variable retain its value whenever scope get over.
You can trace that how many times a function is being called.
void test()
{
static int k; /* k will retain its
value when function scope goes down */
printf("\nThis
function being called %d times ",++k);
}