Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+5 votes
asked in CSC211_Winter2018 by (8 points)

3 Answers

+4 votes
 
Best answer

! has highest precedence, then &&, then finally ||.

So (true || true && !true) evaluates as
(true || true && false)
(true || false)
true

answered by (3k points)
selected by
+4 votes

The three logical operators are,

  1. | |
  2. &&
  3. !
answered by (8 points)
edited by
0

But you didn't specify the precedence -- in an expression like a || !b && c, what order do things get evaluated?

0 votes

|| = or
&& = and
! = not

answered by (8 points)
...