ProgrammingModerate

char cnt[26] = {0}; cnt['c' - 'a']++; printf("%d", (int)('c' - 'a')); What is printed?

  1. A. 2
  2. B. 3
  3. C. 99
  4. D. 1

Correct answer: A. 2

'c' - 'a' is 2 for ASCII letters, and that index is the one incremented.

More C Programming questions

Exams that ask this topic