← Quiz: Structures and Unions: all 10 questions
Quiz: Structures and Unions · Question 7 of 10
What does this print? (code)
What does this print?
#include <stdio.h>
enum Day { MON, TUE = 5, WED };
int main(void) {
printf("%d %d\n", MON, WED);
return 0;
}
- A.1 3
- B.0 2
- C.0 6
- D.0 5
Answer & explanation
Correct answer: 0 6
enum values start at 0; after TUE is set to 5, the next name continues from there, so WED is 6.
Can you get the rest right without peeking?
Take the timed Quiz: Structures and Unions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →