🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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;
}
  1. A.1 3
  2. B.0 2
  3. C.0 6
  4. 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 →