MCQ Single Best Answer Not Set

QWhat will be the output of the program?

#include<stdio.h>

int main()
{
    enum days {MON=-1, TUE, WED=6, THU, FRI, SAT};
    printf("%d, %d, %d, %d, %d, %d\n", ++MON, TUE, WED, THU, FRI, SAT);
    return 0;
}

ID: #2686 Union in C Language 833 views
Question Info
#2686Q ID
Not SetDifficulty
Union in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A -1, 0, 1, 2, 3, 4
  • B Error
  • C 0, 1, 6, 3, 4, 5
  • D 0, 0, 6, 7, 8, 9
Correct Answer: Option B

Explanation

Because ++ or -- cannot be done on enum value.

Share This Question

Challenge a friend or share with your study group.