I'm a beginner so please bear with me. Recently, I started reading storage classes in C and I stumbled upon this question:

‪

```
#‎include‬<stdio.h>
int fun()
{
static int num = 16;
return num--;
}
int main()
{
for(fun(); fun(); fun())
printf("%d \n", fun());
return 0;
}

```

This program outputs : 14 11 8 5 2.

1) Can any please tell me how does this code work?

2) When I keep --num in fun() ,it is running an infinite loop. Why it happens like that?