🔹 Program 1

#include <stdio.h>

void test() {
    static int x = 10;
    x++;
    printf("%d\\n", x);
}

int main() {
    test();
    test();
    test();
}

Output:

11
12
13

✅ Why?

Execution:

✔ Value keeps increasing

✔ Not destroyed after function ends


🔹 Program 2

#include <stdio.h>

void test() {
    static int x;
    x = 10;
    x++;
    printf("%d\\n", x);
}

int main() {
    test();
    test();
    test();
}

Output: