Kali Ini saya Akan Mengspot Program C++ Banyak Kondisi If,Else :
#include <iostream>
using namespace std;
int main()
{
int Nomor;
cout << "This program was created by Yudhi Desril Efendi" << endl;
cout << "Menentukan Nomor Nama" << endl;
cout << "=====================" << endl;
cout<<"1 = Adi, 2 = Ananda, 3 = Andrian"<<endl;
cout<<"4 = Alvin, 5 = Rizky, 6 = Yudhi"<<endl;
cout << "Masukkan Nomor Anda:";
cin >>Nomor;
if (Nomor == 01)
cout << "Adi"<<endl;
else if (Nomor == 02)
cout << "Ananda"<<endl;
else if (Nomor == 03)
cout << "Andrian"<<endl;
else if (Nomor == 04)
cout << "Alvin"<<endl;
else if (Nomor == 05)
cout << "Rizky"<<endl;
else if (Nomor == 06)
cout << "Yudhi"<<endl;
else
cout << "Kode Nama Salah"<<endl;
return 0;
}
Home »
» Contoh Program C++ Banyak Kondisi If,else
Contoh Program C++ Banyak Kondisi If,else
Posted by Yudhi
Posted on 22.30
with No comments
0 komentar:
Posting Komentar