• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
+ 2

Why the output of this code is "true"?

https://code.sololearn.com/cl72k78C2h3n/?ref=app

c++operatorsquestionlogical_operators
10th May 2019, 6:20 PM
ALi
ALi - avatar
2 Answers
+ 3
Because && has higher precedence than ||, so the code is interpreted as true || (false && false && true) == true || false == true.
10th May 2019, 6:26 PM
Diego
Diego - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Decorators in python.
2 Votes
How to install Bcrypt here
1 Votes
Codegames
1 Votes
Please click me
0 Votes
What is happening with sololearn
1 Votes
CAN I FOLLOW YOU🙏🙏!!!
2 Votes
ŰčÙŰ§ÙƒÙ… ŰšŰșيŰȘ Ù†ŰłÙˆÙ„ÙƒÙ… ÙƒÙŠÙŰ§ŰŽ Ù†ŰŻÙŠŰ± ÙƒÙˆŰŻ ويكون Ű”Ű­ÙŠŰ­ŰŸ
0 Votes
Can sololearn have multiple inpus&outputs?
3 Votes
CAN ANYONE TELL ME WHAT TO LEARN NEXT AFTER ADVANCED PYTHON CONCEPTS
1 Votes
Programming language learning
0 Votes