Multiple choice technology programming languages

C++

  1. True

  2. False

  3. It depends on the variable type

  4. None of the Above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In C++, true and false are bool keywords that convert to 1 and 0 respectively in integer contexts. However, the expression true == false is always false regardless of variable type because both are bool constants. The answer depends on context - for bool variables, only true and false values exist; for other types converted to bool, any non-zero value is true and zero is false.