+ 1

What is the answer of the fololwing logical expression: 0||8 How?

27th Sep 2016, 5:54 PM
Devansh Kaushik
Devansh Kaushik - avatar
2 ответов
+ 3
In C++, 0 is false and any non-zero value is true. So 0||8 gives true. Chris G, no it does not fail (albeit it may do something else than expected), = is the assignment operator (you use == to test for equality), and true and false aren't capitalized.
27th Sep 2016, 7:18 PM
Zen
Zen - avatar
0
Thanks Zen... very hepful.
28th Sep 2016, 5:13 AM
Devansh Kaushik
Devansh Kaushik - avatar