7 - Logical Expressions With If Statement
7 - Logical Expressions With If Statement
◦ Relational operators
◦ Logical operators
Examples:
if(x>=y)
if(x!=y)
if(x==y)
if(x+10)>y
The operands of the logical operators can be
boolean variables or relational expressions
that contain relational operators.
Examples:
◦ if(cnt != x+y && m/n>x*y)
◦ if ( x % 7 == 0 || x % 3==0)
Logical && - Produces TRUE only when
_________the relational expressions are TRUE.