- Program :
using namespace std;
int main() {
cout <<"\n----------------COMPARISON OPERATORS----------------\n";
int x = 10;
int y = 13;
cout <<"\n"<<x<<" == "<<y<< " is "<<(x == y); // returns 0 (false)
cout <<"\n"<<x<<" != "<<y<< " is "<<(x != y); // returns 1 (true)
cout <<"\n"<<x<<" > "<<y<< " is "<<(x > y); // returns 1 (true)
cout <<"\n"<<x<<" < "<<y<< " is "<<(x < y); // returns 0 (false)
cout <<"\n"<<x<<" >= "<<y<<" is "<<(x >= y); // returns 1 (true)
cout <<"\n"<<x<<" <= "<<y<<" is "<<(x <= y); // returns 0 (false)
return 0;
}
- Output :
No comments:
Post a Comment