Output the results of several variable comparisons. : relational and logical operators « Operators statements « C++ Tutorial






#include <iostream>

using namespace std;

int main(void)
{
   int a = 4, b = 5;
   cout << a << " > " <<  b << " is " << (a > b) << endl;
   cout << a << " >= " <<  b << " is " << (a >= b) << endl;
   cout << a << " == " <<  b << " is " << (a == b) << endl;
   cout << a << " <= " <<  b << " is " << (a <= b) << endl;
   cout << a << " < " <<  b << " is " << (a < b) << endl;
   return 0;
}








3.2.relational and logical operators
3.2.1.The relational and logical operators
3.2.2.Use And operator to connect two boolean expressions
3.2.3.Logical operator keywords: and, or, not, not_eq
3.2.4.Create an XOR using the C++ logical operators.
3.2.5.Output the results of several variable comparisons.
3.2.6.A Demonstration of Branching Based on Relational Operators