Use Greater-than Operator: > - C++ Operator

C++ examples for Operator:Relational Operator

Description

Use Greater-than Operator: >

Demo Code

#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
    int32_t greaterThan1{ 10 };
    int32_t greaterThan2{ 1 };
    bool isGreaterThan = greaterThan1 > greaterThan2;
    cout << "Is the left greater than the right? " << isGreaterThan << endl;

    int32_t notGreaterThan1{ 10 };
    int32_t notGreaterThan2{ 100 };
    bool isNotGreaterThan = notGreaterThan1 > notGreaterThan2;
    cout << "Is the left greater than the right? " << isNotGreaterThan << endl;

    return 0;/*w w  w.j a  va  2  s .c o  m*/
}

Result


Related Tutorials