ProgrammingModerateWipro · Capgemini pattern

What is printed?

What is printed?
char *names[] = {"Ann", "Bob", "Cy"};
printf("%c %s %zu", names[1][0], names[2], strlen(names[0]));
  1. A. A Cy 3
  2. B. B Cy 3
  3. C. B Bob 3
  4. D. B Cy 4

Correct answer: B. B Cy 3

names is an array of three char pointers. names[1][0] is the first character of "Bob"; names[2] is "Cy"; strlen("Ann") is 3 (the terminator is not counted).

More C Programming questions

Exams that ask this topic