Tugas 3.2

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; int main() { // Nama : Ahmad Fauzan // NIM : 3420230018 int x, y; bool sama, tidakSama, besar, kecil, besarSama, kecilSama; cout << "=====================================" << endl; cout << "\tOperator Perbandingan" << endl; cout << "=====================================" << endl; cout << "Masukkan Nilai X :" << endl; cin >> x; cout << "Masukkan Nilai Y :" << endl; cin >> y; cout << "=====================================" << endl; printf("Nilai X Adalah : %d\n", x); printf("Nilai Y Adalah : %d\n", y); sama = x == y; tidakSama = x != y; besar = x > y; kecil = x < y; besarSama = x >= y; kecilSama = x <= y; cout << "=====================================" << endl; printf("Hasil dari %d == %d : %s \n", x, y, sama ? "1" : "0"); printf("Hasil dari %d != %d : %s \n", x, y, tidakSama ? "1" : "0"); printf("Hasil dari %d > %d : %s \n", x, y, besar ? "1" : "0"); printf("Hasil dari %d < %d : %s \n", x, y, kecil ? "1" : "0"); printf("Hasil dari %d >= %d : %s \n", x, y, besarSama ? "1" : "0"); printf("Hasil dari %d <= %d : %s \n", x, y, kecilSama ? "1" : "0"); cout << "=====================================" << endl; cout << "Nama : Ahmad Fauzan\n"; cout << "Mobile : 085771944504"; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines