-8
int a = 10, b = 12, c = 8

!((a < 5) || (c < (a + b)))

I just tried it in a compiler and it was false.

Rakib
  • 7,435
  • 7
  • 29
  • 45
user3724404
  • 216
  • 2
  • 9

2 Answers2

3

The inner expression:

(a < 5) || (c < (a + b))

evaluates a < 5 as false (since a is 10) and c < (a + b) as true (since 8 is less than 10+12). Performing a Boolean "or" operation on false and true gives you true.

And, given that the next thing you do to that value is the ! (inversion), that true turns into a false.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
0
c < (a + b) == 8 < (10 + 12) == 8 < 22 == true
a < 5 == 10 < 5 == false
(a < 5) || (c < (a + b)) == false || true == true
!((a < 5) || (c < (a + b))) == !(true) == false
S. Ahn
  • 633
  • 5
  • 8