Contoh Operator logika & relasi





#include<iostream>

using namespace std;

int main()
{
    int A,B,C,K,L,M;
    A = 3;
    B = 6;
    C = 2;
    K = 5;
    L = 4;
    M = 3;

    cout<< "\t OPERATOR LOGIKA & RELASI \n\n";

    cout<< "Hasil 1 = "<<(4+2>A && B-2>3+2 || B+2 <= 6+2)<<endl;
    cout<< "Hasil 2 = "<<(K+5<M || C*M<L && 2*M-L>0)<<endl;
    cout<< "Hasil 3 = "<<(L+5<M || C*K<L && 2*K-L>0)<<endl;
    cout<< "Hasil 4 = "<<(A*4<=3*M+B)<<endl;
    cout<< "Hasil 5 = "<<(K+10>A && L-2>4*C)<<endl<<endl;

    return 0;
}



Comments