Difficulty: Easy
Correct Answer: The if statement selects a statement for execution based on the value of a Boolean expression.
Explanation:
Introduction / Context:
This question tests knowledge of how C# selection statements behave, particularly if/else and switch.
Given Data / Assumptions:
Concept / Approach:
In C#, if evaluates a Boolean expression and selects a branch accordingly. switch requires unique case values and, unlike C, does not allow implicit fall-through between non-empty cases.
Step-by-Step Solution:
Verification / Alternative check:
Any C# specification summary confirms D; B and E are explicitly disallowed; A contradicts common usage.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing C# switch rules with C/C++ behavior.
Final Answer:
The if statement selects a statement for execution based on the value of a Boolean expression.
Discussion & Comments