Difficulty: Easy
Correct Answer: Morning
Explanation:
Introduction / Context:
String literals are arrays of characters that decay to pointers when used in expressions. Adding an integer to such a pointer advances the pointer by that many characters. Passing the offset pointer to printf prints from that position onward.
Given Data / Assumptions:
Concept / Approach:
printf with a single pointer argument and no format specifiers treats the argument as a format string. Here the pointed-to substring is 'Morning\n'. It contains no % directives, so it prints as plain text starting at 'M'.
Step-by-Step Solution:
Verification / Alternative check:
Change the offset to 0 to print the full phrase; change to 6 to print 'orning\n'.
Why Other Options Are Wrong:
Common Pitfalls:
Forgetting that pointer addition steps by characters; misunderstanding that printf without format specifiers still prints the string when the data contains no % symbols.
Final Answer:
Morning.
Discussion & Comments