Assalamualikum w.w,
PROBLEM SOLVING NO.1 HAL 414
Program mengunakan 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;
}
Gambar program nya :
Gambar output nya:
Alhamdulillah
Selamat mencoba dan semoga bermanfaat :)
Waalaikumsalam w.w.
0 komentar:
Posting Komentar