Visual C# Guide
Relational Operators
Relational operators are used in Boolean expressions (expressions which evaluate to either true or false) when we want to test things in our programs.
Description | In C# |
Equal to | == |
Less than | < |
Greater than | > |
Not equal to | != |
Less than or equal to | <= |
Greater than or equal to | >= |
Boolean Operators
In addition to the relational operators, the boolean operators, NOT, AND, OR can also be used in boolean expressions.
! (Number < 30) | Number is not less than 30 |
(Number > 5) && (Number < 30) | Number is greater than 5 and less than 30 |
(Number < 5) || (Number > 30) | Number is less than 5 or Number is greater than 30 |