Contoh Program C++ Banyak Kondisi If,else

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;
}

Komentar

Postingan populer dari blog ini

Makalah Magang "LAPORAN PRAKTEK KERJA INDUSTRI BAGIAN (ISP) INTERNET SERVICE PROVIDER"

Proposal Kerja Proyek "Membangun Jaringan Sederhana Client Server Sekolah Berbasis Linux Debian"

MAKALAH TUTORIAL CARA MENG-INSTALL WINDOWS 7 DI VMWARE