C++ examples for Operator:Relational Operator
Uses the relational and logical operators, on two integers
#include <iostream> using namespace std; int main() {//from w w w.j a v a2 s .c o m int i,j; cout << "Enter an integer: "; cin >> i; cout << "Enter another integer: "; cin >> j; cout << "i > j is " << (i > j) << endl; cout << "i < j is " << (i < j) << endl; cout << "i >= j is " << (i >= j) << endl; cout << "i <= j is " << (i <= j) << endl; cout << "i == j is " << (i == j) << endl; cout << "i != j is " << (i != j) << endl; cout << "i && j is " << (i && j) << endl; cout << "i || j is " << (i || j) << endl; cout << " (i < 10) && (j < 10) is " << ((i < 10) && (j < 10)) << endl; }