Quick actions

cmd+k|ctrl+k

Navigation

Languages

Algoritma3.2

Snippet info

Language

Cpp

Visibility

public

Author

aderawahyu.s

Created

2024-10-30T13:14:34.720002Z

Updated

2024-11-10T03:43:09.352131Z

#include <iostream>
using namespace std;
// Adera Wahyu Sutrisno
// 3420230039
// PPKM

int main() {
    puts("======================================");
    puts(" Contoh Operator Perbandingan ");
    puts("======================================");
    float a, b, c, d, x=8, y=4;
    cout<<"Nilai x adalah = "<<x<<endl;
    cout<<"Nilai y adalah = "<<y<<endl;
    
    /* Bernilai Sama Dengan */
    a = x == y;
    /* Bernilai Tidak Sama Dengan */
    b = x != y;
    /* Bernilai Lebih Besar Dari */
    c = x > y;
    /* Bernilai lebih Kecil Dari */
    d = 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;
    puts("======================================");
    
    return 0;
}
INFO