Simplify the following expressions Assume b is a variable of
Simplify the following expressions.
Assume b is a variable of type boolean.
b == true
b == false
b != true
b != false
Solution
note:
==,!= are called relational operators.They tell relation between 2 things
boolean values can have only 2 values ,true or false where true means 1 and false means 0
! symbol means complemnent of a number.If true,then not of true becomes false i.e !(1)=0
or
If false,then not of false becomes true i.e !(0)=1
b==true
this means if b value is true,then output will be 1,otherwise 0
b==false
this means if b value is false,then output will be 1,otherwise 0
b!=true
this means if b value is false,then output will be 1,otherwise 0
b!=false
this means if b value is true,then output will be 1,otherwise 0
