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