Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program menentukan nilai menggunakan Operator Relasi
- // Task No.1 file 066-P03.pptx
- // Amrul Mubarak Harahap
- // 19T03 - 1901098
- #include <iostream>
- #include <string>
- #include <cstring>
- using namespace std;
- int main(){
- int a, b, c, d, e, f, g, h, i;
- string hasil0, hasil1, apa, tanya;
- apa = "Apakah ";
- tanya = " ? ";
- cout << "Masukkan nilai a: ";cin >> a;
- cout << "Masukkan nilai b: ";cin >> b;
- d = a < b;
- e = a > b;
- f = a != b;
- g = a <= b;
- h = a >= b;
- i = a == b;
- system ("cls");
- cout << "OPERATOR RELASI" << endl;
- cout << "==========================================="<< endl;
- cout << apa << a << " < " << b << tanya << d << endl;
- cout << apa << a << " > " << b << tanya << e << endl;
- cout << apa << a << " != " << b << tanya << f << endl;
- cout << apa << a << " <= " << b << tanya << g << endl;
- cout << apa << a << " >= " << b << tanya << h << endl;
- cout << apa << a << " == " << b << tanya << i << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement