C storage Classes and Type Qualifiers | Q - 10

Last Updated :
Discuss
Comments

Which variable will retain its value across multiple calls?

C
#include <stdio.h>

void fun() {
    auto int x = 0;
    x++;
    printf("%d ", x);
}

int main() {
    fun();
    fun();
    return 0;
}


1 1

1 2

2 3

0 1

Tags:
Share your thoughts in the comments