Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas3.2

Snippet info

Language

Cpp

Visibility

public

Author

asiyahtflh

Created

2024-10-26T12:41:07.648165Z

Updated

2024-10-26T12:41:07.648165Z

#include <iostream>
using namespace std;

//Nama : Asiyah Thufailah
//Nim  : 3420210005

int main() {
    puts("===============================");
    puts(" Contoh Operator Perbandingan ");
    puts("===============================");
    float a, b, c, d, e, f, x=8, y=9;
    cout<<"Nilai x adalah = "<< x <<endl;
    cout<<"Nilai y adalah = "<< y <<endl;
    
    a = x == y;
    b = x != y;
    c = x > y;
    d = x < y;
    e = x >= y;
    f = x <= y;
    
    puts("================================");
    cout<<"Hasil dari x == y adalah" << a << endl;
    cout<<"Hasil dari x != y adalah" << b << endl;
    cout<<"Hasil dari x > y adalah" << c << endl;
    cout<<"Hasil dari x < y adalah" << d << endl;
    cout<<"Hasil dari x >= y adalah" << e << endl;
    cout<<"Hasil dari x <= y adalah" << f << endl;
    puts("================================");
   
    return 0;
}
INFO