Mencari nilai lebih besar C++

1. Raptor


2. C++

#include <iostream>
using namespace std;
int cetak(int x, int y){
    if (x>y){
        cout<<"A>B"<<endl;
    }else if (x<y){
        cout<<"A<B"<<endl;
    }else {
        cout<<"A=B"<<endl;
    }
}
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
    int a,b;
    cout<<"Masukan Nilai A =";cin>>a;
    cout<<"Masukan Nilai B =";cin>>b;
    cetak(a,b);
    return 0;
}

Komentar