ProgrammingModerateIBM · Deloitte pattern

What is printed?

What is printed?
enum { A, B = 5, C, D = 2, E };
printf("%d %d %d", A, C, E);
  1. A. 1 6 3
  2. B. 0 2 4
  3. C. 0 6 3
  4. D. 0 6 6

Correct answer: C. 0 6 3

Enumerators start at 0 and each one without a value is the previous plus 1: A = 0, B = 5, C = 6, D = 2, E = 3. Values may repeat or go down.

More C Programming questions

Exams that ask this topic