Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas3.2

Snippet info

Language

Cpp

Visibility

public

Author

junitalaras18

Created

2024-10-26T09:35:48.080339Z

Updated

2024-10-26T13:34:35.345068Z

#include <iostream>
using namespace std;
// Nama : Junita Laras Wati
// NIM  : 3420230028

int main() {
    int x, y;

    cout << "\n==================================" << endl;
    cout << "   Contoh Operator Perbandingan\n";
    cout << "==================================" << endl;
    
    cout << "Masukan nilai x         : ";
    cin >> x;
    cout << "\nMasukan nilai y         : ";
    cin >> y;
    
    cout << "\n==================================" << endl;
    cout << "Nilai x adalah          : " << x << endl;
    cout << "Nilai y adalah          : " << y << endl;
    cout << "==================================" << endl;
    cout << "Hasil dari " << x << " == " << y << "     : " << (x == y) << endl;
    cout << "Hasil dari " << x << " != " << y << "     : " << (x != y) << endl;
    cout << "Hasil dari " << x << " > " << y << "      : " << (x > y) << endl;
    cout << "Hasil dari " << x << " < " << y << "      : " << (x < y) << endl;
    cout << "Hasil dari " << x << " >= " << y << "     : " << (x >= y) << endl;
    cout << "Hasil dari " << x << " <= " << y << "     : " << (x <= y) << endl;
    cout << "==================================" << endl;
    cout << "Nama    : Junita Laras Wati" << endl;
    cout << "Mobile  : 085819287572";

    return 0;
}
INFO