Mega Code Archive

 
Categories / C++ Tutorial / Operators Statements
 

Need parentheses around the conditional expression

#include <iostream> using namespace std; int main(){    int x, y;    cout << "Enter two integers: ";    cin >> x >> y;    cout << x << ( x == y ? " is" : " is not" )          << " equal to " << y << endl;    return 0; }