Friday, May 29, 2020

Comparison Operators


Equality Operator


This operator also known as equal to operator. (==)

This is a binary operator with left-sided binding. It needs two arguments & checks if they are equal.









Inequality Operator


This operator also known as not equal to operator. (!=)









Greater than / Greater than or equal to / Less than / Less than or equal to




Write a simple two-line program that takes the parameter “n” as input, which is an integer, and prints “False” if “n” is less than 100, and “True” if “n” is greater than or equal to 100.





Here,


If we input n=55 then output is False

If we input n=99 then output is False

If we input n=100 then output is True

If we input n=101 then output is True

If we input n=-5 then output is False

If we input n=+123 then output is True

No comments:

Post a Comment