Difficulty: Easy
Correct Answer: ott
Explanation:
Introduction / Context:
This problem checks array-of-strings indexing through argv and character indexing within each string. The program prints the first letter of each user-supplied argument in order.
Given Data / Assumptions:
Concept / Approach:
argv is an array of char*; argv[i] is a pointer to the i-th C string. Index zero selects the first character of that string. Concatenation results from printing with %c and no separators.
Step-by-Step Solution:
Verification / Alternative check:
Changing the format to "%c " would show "o t t " with spaces; the characters are the same in order.
Why Other Options Are Wrong:
Common Pitfalls:
Accidentally starting the loop at i=0 prints the first letter of argv[0] (program name) too; here we intentionally start at the first user argument.
Final Answer:
ott
Discussion & Comments