2.8 Comparison Operators

Stasoz
2 min readApr 6, 2022

--

You can check this course on my website.

Comparison operators are used to compare two operands and return bool value (true or false).

  • == — Equal to. If both operands are equal, returns true, otherwise false .
  • != — Not equal. If operands are not equal, returns true, otherwise false.
  • > — Greater than. Returns true if the first operand is greater than the second, otherwise false.
  • < — Less than. Returns false if the first operand is less than the second, otherwise true.
  • >= — Greater than or equal to. Returns true if the first operand is greater than or equal to the second, otherwise false.
  • <= — Less than or equal to. Returns true if the first operand is less than or equal to the second, otherwise false.

Summary — Operators Precedence and Associativity

Contents

Previous article -> 2.7 Assignment Operators

Next article -> 2.9 Logical Operators

Join to our community in Telegram — https://t.me/itifico

If you want to support me, you can buy me a cup of coffee and I will drink it when I write the next article :)

Donations list:

  1. Dinesh Chintalapudi — 3$
  2. Unknown — 5$
  3. Neisy — 3$
  4. Unknown — 3$

--

--

Stasoz
Stasoz

Written by Stasoz

Full Stack Developer who is inspired by new technologies

No responses yet