Difficulty: Easy
Correct Answer: There is no error and c gets True.
Explanation:
Introduction / Context:
This checks understanding of Boolean comparisons and logical negation in C# as well as proper typing of Boolean variables.
Given Data / Assumptions:
Concept / Approach:
(a > b) evaluates to a Boolean. The operator ! negates a Boolean, flipping true to false and vice versa. C#'s bool is not an int; assigning 1 or 0 to bool is not the model—use true/false.
Step-by-Step Solution:
Verification / Alternative check:
Print c to the console; it outputs True.
Why Other Options Are Wrong:
Common Pitfalls:
Thinking of bool as an integer; in C#, bool is distinct and should be used with true/false.
Final Answer:
There is no error and c gets True.
Discussion & Comments