ProgrammingHardTCS NQT · Accenture

What is printed?

What is printed?
#include <stdio.h>
int main(void) {
    printf("%s", "ab" "cd");
}
  1. A. ab
  2. B. cd
  3. C. abcd
  4. D. abcdab

Correct answer: C. abcd

Adjacent string literals are concatenated during translation, so the argument is the single string abcd.

More C Programming questions

Exams that ask this topic