Why relational operators and not simply true / false?

Why should we use relational operators with numbers where we could simply give it a true or false value?
w/ operators >>> !( 1 < 8 && (5 > 2 || 3 < 5)); <<<<

w/ true or false >>> !true && true || true;

What are the differences?
Could you give me an example where the code w/ operators cannot be replaced by a true or false value?

Those numbers are arbitrary. Imagine they were variables instead.
if(price > income/10 || storeNextDoorPrice < thisStore)

We don’t want to sit there and think out long boolean expressions, or do the math involved. So we tell the cpu to do it.

Right, that makes sense. Thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.