Multiple choice

Suppose p, q, r are integer variables with value 10, 20, 30 respectively. What will be the value of the following expression? ! ((q+r)>(r-10))

  1. 0

  2. 1

  3. -1

  4. None of the above

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

Inside the parentheses: q+r=50, r-10=20. 50>20 evaluates to true (1). The ! operator negates this to false (0). In C++, true is 1 and false is 0.