ProgrammingModerate

int count = 0; for (const char *p = "a1b22c"; *p; p++) if (isdigit((unsigned char)*p)) count++; printf("%d", count); What is printed?

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

Correct answer: A. 3

The digits are 1, 2 and 2, giving three digit characters in total.

More C Programming questions

Exams that ask this topic