&& operator determines if two different relational operators are both true. - C++ Operator

C++ examples for Operator:Logical Operator

Description

&& operator determines if two different relational operators are both true.

Demo Code

#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
    bool isTrue { (10 == 10) && (12 == 12) };
    cout << "True? " << isTrue << endl;

    bool isFalse = isTrue && (1 == 2);
    cout << "True? " << isFalse << endl;

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

Result


Related Tutorials