Question 6
What will be the output of the following program?
#include <stdio.h>
void increment(void) {
static int count = 5;
count++;
printf("%d ", count);
}
int main(void) {
increment();
increment();
increment();
return 0;
}Detailed Solution
Local static variables maintain their updated state across function invocations and are initialized only once prior to program execution.