Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+5 votes
asked in CSC211_Winter2018 by (1 point)

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 (1 point)
selected by
+4 votes

The three logical operators are,

  1. | |
  2. &&
  3. !
answered by (1 point)
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 (1 point)
...