Categories

Jun 13, 2019 in C++

Q: What is the output of this C code?

    #include <stdio.h>
    #define MAX 2
    enum bird {SPARROW = MAX + 1, PARROT = SPARROW + MAX};
    int main()
    {
        enum bird b = PARROT;
        printf("%d\n", b);
        return 0;
    }
a. Compilation error
b. Undefined value
c. 5
d. 2

Related questions

Madanswer
Jun 13, 2019 in C++
Jun 13, 2019 in C++
Jun 13, 2019 in C++
...