Uses the relational and logical operators, on two integers - C++ Operator

C++ examples for Operator:Relational Operator

Description

Uses the relational and logical operators, on two integers

Demo Code

#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;
}

Result


Related Tutorials