Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas3.2

Snippet info

Language

Cpp

Visibility

public

Author

mikoshiba27

Created

2024-10-26T09:16:21.669128Z

Updated

2024-11-02T08:31:14.314182Z

#include <iostream>
#include <cstdio>  // untuk fungsi puts

using namespace std;

int main() {
    int x = 8;
    int y = 9;

//Nama: Miko Ardiansyah
//Nim: 3420230005
    puts("======================================");
    puts("Contoh Operator Perbandingan  ");
    puts("======================================");

    cout << "Masukan nilai x\t: " << x << endl;
    cout << "Masukan nilai y\t: " << y << endl;
    puts("======================================");

    cout << "Nilai x adalah\t: " << x << endl;
    cout << "Nilai y adalah\t: " << y << endl;
    puts("======================================");

    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;

    puts("======================================");
    puts("Nama   : Miko Ardiansyah");
    puts("Mobile : 0881023570416");

    return 0;
}
INFO