ProgrammingHardGATE CS · Campus placements

enum { A, B = 5, C }; What is the value of C?

  1. A. 6
  2. B. 5
  3. C. 2
  4. D. 7

Correct answer: A. 6

An enumerator without an explicit value takes the previous value plus one, so C is 5 + 1 = 6. A and B hold 0 and 5.

More C Programming questions

Exams that ask this topic