Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas3.2

Snippet info

Language

Cpp

Visibility

public

Author

yazidrizqi

Created

2024-10-26T09:39:18.531741Z

Updated

2024-10-26T10:01:17.930201Z

#include <iostream>
using namespace std;

int main() {
    //Yazid Rizqi
    //3420230012
    //Teknik Informatika semester 3
    
    puts("================================");
    puts("  Contoh Operator Perbandingan");
    puts("================================");
    int a, b, c, d, e, f, x=8, y=9;
    cout<<"Masukkan nilai X \t: ";cin>>x;
    cout<<"\nMasukkan nilai Y \t: ";cin>>y;
    puts("\n================================");
    cout<<"Nilai x adalah \t\t: "<<x<<endl;
    cout<<"Nilai y adalah \t\t: "<<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 \t: "<<a<<endl;
    cout<<"Hasil dari x != y \t: "<<b<<endl;
    cout<<"Hasil dari x > y \t: "<<c<<endl;
    cout<<"Hasil dari x < y \t: "<<d<<endl;
    cout<<"Hasil dari x >= y \t: "<<e<<endl;
    cout<<"Hasil dari x <= y \t: "<<f<<endl;
    puts("================================");
    cout<<"Nama  : Yazid Rizqi"<<endl;
    cout<<"Email : [email protected]"<<endl;
    return 0;
}
INFO