Difficulty: Medium
Correct Answer: XXXXXIndiaBBBBB
Explanation:
Introduction / Context:
The snippet mixes switch and if/else to print characters across a numeric range. We must track control flow for negative, zero, and positive values.
Given Data / Assumptions:
Concept / Approach:
Count how many times each branch fires: negatives produce X, zero prints India, positives produce B.
Step-by-Step Solution:
Verification / Alternative check:
Mental simulation or quick run confirms the exact sequence.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming if/else executes before switch or miscounting loop bounds.
Final Answer:
XXXXXIndiaBBBBB
Discussion & Comments