Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program menentukan nilai menggunakan Operator Logika
- // Task No.2 file 066-P03.pptx
- // Amrul Mubarak Harahap
- // 19T03 - 1901098
- #include <iostream>
- using namespace std;
- int main(){
- int m, m2, a, b, c, d;
- cout << "Masukkan nila m pertama: ";cin >> m;
- cout << "Masukkan nila m kedua: ";cin >> m2;
- a = !(m >= 0 && m2 <= 150);
- b = (m >= 0 && m2 <= 150);
- c = (m >= 0 || m2 <= 150);
- d = !(m >= 0 || m2 <= 150);
- system ("clear");
- cout << "OPERATOR LOGIKA" << endl;
- cout << "==========================================="<< endl;
- cout << m << " >= 0 && " << m2 << " <= 150 >--> " << a << endl;
- cout << m << " >= 0 && " << m2 << " <= 150 >--> " << b << endl;
- cout << m << " >= 0 || " << m2 << " <= 150 >--> " << c << endl;
- cout << m << " >= 0 || " << m2 << " <= 150 >--> " << d << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement