This operator is use more to combine two more condition.
In below table you can see their symbol and use .
Operator Symbol | Operator Name | Operator Description | ||
&& | And Operator | Use to add two conditions and if both are true than it will return true. | ||
! | Not Operator | It is use to reverse the result. | ||
void main()
{
int a = 5;
int b = 7;
// Using And Operator
bool c = a > 10 && b < 10;
print(c); //fasle
// Using Or Operator
bool d = a > 10 || b < 10;
print(d);//true
// Using Not Operator
bool e = !(a > 10);
print(e);//true
}
ย