adplus-dvertising
frame-decoration

Question

What is the output of this C code?
#include <stdio.h>
    int main()
    {
        auto i = 10;
        const auto int *p = &i;
        printf("%d\n", i);
    }

a.

10

b.

Compile time error

c.

Depends on the standard

d.

Depends on the compiler

Posted under C Programming

Answer: (a).10

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this C code? #include <stdio.h> int main() { auto i = 10; const auto int *p = &i; printf("%d\n", i); }