Sabtu, 26 Maret 2016

kasus 3.2

#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
    int x,y,z;
    char indeks;
    cout<<"---==mencari bilangan terbesar antara 3 bilangan==---"<<endl<<endl;
    cout<<" masukan bilangan ke 1 : ";cin>>x;
    cout<<" masukan bilangan ke 2 : ";cin>>y;
    cout<<" masukan bilangan ke 3 : ";cin>>z;
    cout<<endl;
    if(x>y && x<z)
    cout<<" nila bilangan terbesar "<<x;
    else if(y>x && y<z){
    cout<<" nilai bilangan terbesar "<<y;
}
    else
    cout<<" nilai bilangan terbesar "<<z;
    cout<<endl;
    return 0;
}

Tidak ada komentar:

Posting Komentar