Mencari bilangan terbesar atau terkecil menggunakan c++

2 Apr

#include <iostream.h>
#include <conio.h>

void main()
{
cout<<“Program Mencari Bilangan Terbesar”<<endl;
int bil1, bil2, bil3, terbesar;
cout<<“Masukkan bilangan 1 : “;
cin>>bil1;
cout<<“Masukkan bilangan 2 : “;
cin>>bil2;
cout<<“Masukkan bilangan 3 : “;
cin>>bil3;
if(bil1 > bil2)
terbesar = bil1;
else
terbesar = bil2;
if(bil3 > terbesar)
terbesar = bil3;
cout<<“Bilangan Terbesar = “<<terbesar;
getch();
}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: