{ A destination to learn coding }

Operators


Logical Operators

Operator Example
&& AND Operator (a<10)&&(b>20)
It returns true value only when both the condtions are satisfied
|| OR Operator (a<10)||(b>20)
It returns true value when atleast one of the condition is true.
! NOT Operator If "(a<10)!(b>20)" is true, the logical NOT operator makes it false.

Logical operators are used to perform logical operators on the given expressions.

#include<stdio.h>
int main()
{
int res1;

res1=(5>4)&&(3<9);
printf("%d",res1);
/*output: 1*/

res1=((5*3)>20)||(20>15);
printf("%d",res1);
/*output: 1*/

res1=!(1<2);
{
 printf("%d",res1);
}
/*output:0*/

return 0;
}
C Codes