[Note] C # basic introduction -- Comparison operators of C,
The comparison operator is used to compare the number size or compare equal numbers. Comparison operators in C # include:
| = |
Equal |
| ! = |
Not equal |
| > |
Greater |
| < |
Less |
| > = |
Greater than or equal |
| <= |
Less than or equal |
Note: "equal" indicates that two equal values are composed of two "=.
The result of the comparison operation is boolean. bool indicates true (true) and false (not true) in logic ). True and false are represented by the true and false keywords.
Namespace Test {class Program {static void Main (string [] args) {int x = 5; int y = 6; Console. writeLine (x> = y); Console. writeLine (x <= y );}}}
In the above program, if x> = y is not true, false is returned. If x <= y is true, true is returned. Running result:
The above is taken from MOOC course C # getting started with development