🎙 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 3 of 10

What does this print? (code)

What does this print?

#include <stdio.h>
enum Color { RED, GREEN = 5, BLUE };
int main(void) {
    printf("%d %d %d", RED, GREEN, BLUE);
    return 0;
}
  1. A.0 1 2
  2. B.0 5 6
  3. C.1 5 6
  4. D.0 5 2
Answer & explanation

Correct answer: 0 5 6

RED starts at 0, GREEN is set to 5, BLUE continues to 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 →