forked from Adityaranjanpatra/Btecky2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Somnath2
31 lines (24 loc) · 943 Bytes
/
Somnath2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
int main() {
// Logical OR (||)
bool condition1 = true;
bool condition2 = false;
bool result_or = condition1 || condition2;
std::cout << "Logical OR:" << std::endl;
std::cout << "Condition1 || Condition2: " << (condition1 || condition2) << std::endl;
std::cout << "Result: " << result_or << std::endl;
// Logical NOT (!)
bool condition3 = true;
bool result_not = !condition3;
std::cout << "\nLogical NOT:" << std::endl;
std::cout << "!Condition3: " << !condition3 << std::endl;
std::cout << "Result: " << result_not << std::endl;
// Logical XOR (^)
bool condition4 = true;
bool condition5 = true;
bool result_xor = condition4 ^ condition5;
std::cout << "\nLogical XOR:" << std::endl;
std::cout << "Condition4 ^ Condition5: " << (condition4 ^ condition5) << std::endl;
std::cout << "Result: " << result_xor << std::endl;
return 0;
}