4. Comparison Operator
Sr.
No.
Operato
r
Description Example
1. == Checks if the value of two operands are equal or not, if
yes then condition will true
If a=5 and b=3
(a==b) is not true
2. != Checks if the value of two operands are equal or not, if
value are not equal then condition become true
(a!=b) is true
3. <> Checks if the value of two operands are equal or not, if
value are not equal then condition become true
(a<>b) is true. This is
similar to != operator
4. > Checks if the value of left operand is greater than value
of right operand, if yes then condition become true
(a>b) is true
5. < Checks if the value of left operand is less than the value
of right operand, if yes then condition become true
(a<b) is not true
6. >= Checks if the value of left operand is greater than or
equal to the value of right operand, if yes then
condition become true
(a>=b) is true
7. <= Opposite of above Condition (a<=b) is not true
5. Assignment Operator
Sr. No. Operator Example
1. = (c=a+b) will assign value of a+b into c
2. += c+=a or c=c+a
3. - = c-=a or c=c-a
4. *= c*=a or c=c*a
5. /= c/=a or c=c/a
6. %= c%=a or c=c%a
7. **= c**=a or c=c**a
8. //= c//=a or c=c//a
6. Logical Operator
Sr. No. Operator Example
1. and (a and b) if both of high then it will return
high
2. or (a or b) if anyone is high then it will return
high
3. not (not a) it will return compliment of a
YouTube Link of this pdf:- https://youtu.be/46_bG-5SDRs