Home » C Programming » Constants » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    int main()
    {
    enum {Blue = 4, Green, Yellow = 5, Red};
    printf("Red = %d\n", Red);
    }
    1. Red = 4
    2. Red = 5
    3. Red = 6
    4. All of above
    5. None of these
Correct Option: C

In enum, the value of constant is defined to the recent assignment from left.



Your comments will be displayed only after manual approval.