Examveda
Examveda

What will be the output of the following 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. 5

C. Undefined value

D. 2

Answer: Option B


This Question Belongs to C Program >> C Fundamentals

Join The Discussion

Related Questions on C Fundamentals