ProgrammingModerateTCS NQT · Infosys pattern

What is printed?

What is printed?
char *s = "Campus";
printf("%c%s", *(s + 1), s + 4);
  1. A. aus
  2. B. apus
  3. C. Cus
  4. D. amus

Correct answer: A. aus

Indexing from 0: C a m p u s. *(s + 1) is the character 'a'; s + 4 is a pointer to "us", which %s prints until the '\0'. Together: aus.

More C Programming questions

Exams that ask this topic