ProgrammingHard
printf("%zu", strlen("\\n")); What is printed?
- A. 1
- B. 3
- C. 2
- D. 0
Correct answer: C. 2
"\\n" is a backslash followed by the letter n, so it has two characters and no newline.
More C Programming questions
- printf("%d", strlen("a0b")); What is printed?
- char s = "x"; char t[2] = {'y', '0'}; int r = strcmp(s, t); What does r look like?
- printf("[%03d]", 7); What is printed?
- printf("[%5s|%-5s]", "ab", "cd"); What is printed?
- printf("%x %o", 255, 8); What is printed?
- char s[5] = "abcd"; printf("%s", s + 2); What is printed?