Comparison operators are operators used for comparing two elements, these are mostly used with if-else conditions as they return true-false as result.
There are mainly 6 Comparison Operators:

Note: Comparison Operators have only two return values, either true (1) or false (0).
Example Code to cover all 6 Comparison Operators:
#include <iostream>
using namespace std;
int main(){
int a, b;
a = 5, b = 3;
// example to demonstrate '>' operator
if (a > b)
cout << "a is greater than b" << endl;
else
cout << "a is not greater than b" << endl;
a = 5, b = 5;
// example to demonstrate '>=' operator
if (a >= b)
cout << "a is greater than or equal to b" << endl;
else
cout << "a is not greater than or equal b" << endl;
a = 2, b = 3;
// example to demonstrate '<' operator
if (a < b)
cout << "a is lesser than b" << endl;
else
cout << "a is not lesser than b" << endl;
a = 2, b = 3;
// example to demonstrate '<=' operator
if (a <= b)
cout << "a is lesser than or equal to b" << endl;
else
cout << "a is not lesser than or equal to b"
<< endl;
a = 5, b = 5;
// example to demonstrate '==' operator
if (a == b)
cout << "a is equal to b" << endl;
else
cout << "a is not equal to b" << endl;
a = 5, b = 3;
// example to demonstrate '!=' operator
if (a != b)
cout << "a is not equal to b" << endl;
else
cout << "a is equal to b" << endl;
return 0;
}
Output
a is greater than b a is greater than or equal to b a is lesser than b a is lesser than or equal to b a is equal to b a is not equal to b