E-Book Problem Solving And Program Design in C : Programming No.1, Hal. 414

Program Dev C++ :

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

using namespace std;

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
    int cur_month;
    cout<<"\n 1 = Happy New Year ";
    cout<<"\n 2 = Summer begins  ";
    cout<<"\n 3 = Back to school ";
    cout<<"\n 4 = Happy Holidays ";
  
    cout<<"\nMasukkan Sebuah Angka :";
    cin>>cur_month;
     if (cur_month == 1){
  
cout<<"Happy New Year\n";}
else if (cur_month == 2){
cout<<"Summer begins\n";}

else if (cur_month == 3){
cout<<"Back to school\n";
}

else if (cur_month == 4){
    cout<<"Happy Holidays\n";
}
else {
    cout<<"angka yang anda masukkan salah";
}

    return 0;
}

Sekian dan Terima Kasih, Semoga Bermanfaat.

Comments

Popular posts from this blog

Program Menghitung Hambatan Seri dan Pararel

Menghitung nilai ipk mahasiswa

Rencana Kuliah Bulan ke-3 : Menggeser Elemen Array