ProgrammingHardAccenture · C

What is printed?

What is printed?
int n = printf("ab%d", 123);
printf(" %d", n);
  1. A. ab123 3
  2. B. ab123 6
  3. C. ab123 5
  4. D. ab123 0

Correct answer: C. ab123 5

printf returns the number of characters written: 'a', 'b' and '1', '2', '3' make 5.

More C Programming questions

Exams that ask this topic