Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas3.2

Snippet info

Language

Cpp

Visibility

public

Author

muhammadirfanzidni801

Created

2024-10-26T09:07:46.699158Z

Updated

2024-10-26T09:08:12.359485Z

#include <iostream>
using namespace std;

int main() {
    int x, y;

    // Menampilkan judul
    cout << "==========================================" << endl;
    cout << "\tContoh Operator Perbandingan" << endl;
    cout << "==========================================" << endl;

    // Memasukkan nilai x dan y
    cout << "Masukan nilai x\t\t: " << endl;
    cin >> x;
    cout << "Masukan nilai y\t\t: " << endl;
    cin >> y;

    // Menampilkan nilai x dan y
    cout << "==========================================" << endl;
    cout << "Nilai x adalah\t\t: " << x << endl;
    cout << "Nilai y adalah\t\t: " << y << endl;
    cout << "==========================================" << endl;

    // Operasi perbandingan
    cout << "Hasil dari " << x << " == " << y << "\t: " << (x == y) << endl;
    cout << "Hasil dari " << x << " != " << y << "\t: " << (x != y) << endl;
    cout << "Hasil dari " << x << " > " << y << "\t: " << (x > y) << endl;
    cout << "Hasil dari " << x << " < " << y << "\t: " << (x < y) << endl;
    cout << "Hasil dari " << x << " >= " << y << "\t: " << (x >= y) << endl;
    cout << "Hasil dari " << x << " <= " << y << "\t: " << (x <= y) << endl;
    cout << "==========================================" << endl;

    // Menampilkan nama dan nomor telepon
    cout << "Nama\t: Muhammad Irfan Zidni" << endl;
    cout << "Mobile\t: 085819266473" << endl;

    return 0;
}
INFO