Comparing numbers

In programming, we can compare values using the following operators:

  • Operator < (less than)
  • Operator > (greater than)
  • Operator <= (less than or equals)
  • Operator >= (greater than or equals)
  • Operator == (equals)
  • Operator != (inequals)

When compared the result is boolean value true or false, depending on whether the result of the comparison is true or false.

Examples of comparing numbers

Note that when printing the true and false values in C # language, they are printed with a capital letter, respectively True and False.

results matching ""

    No results matching ""