Lanjut ke konten

Kalkulator sederhana

#include
#include

main(){
int bil1,bil2,pil;
float hsl;
cout<<"Pilihlah salah satu operasi yang anda inginkan :\n";
cout<<"[1] Operasi Penjumlahan\n";
cout<<"[2] Operasi Pengurangan\n";
cout<<"[3] Operasi Perkalian\n";
cout<<"[4] Operasi Pembagian\n";
cout<>pil;

switch (pil)
{ case 1:
cout<>bil1;
cout<>bil2;
hsl=bil1+bil2;
cout<<"Hasil penjumlahannya = "<<hsl<<endl<<endl;
break;
case 2:
cout<>bil1;
cout<>bil2;
hsl=bil1-bil2;
cout<<"Hasil pengurangannya = "<<hsl<<endl<<endl;
break;
case 3:
cout<>bil1;
cout<>bil2;
hsl=bil1*bil2;
cout<<"Hasil perkaliannya = "<<hsl<<endl<<endl;
break;
case 4:
cout<>bil1;
cout<>bil2;
hsl=bil1/bil2;
cout<<"Hasil pembagiannya = "<<hsl<<endl<<endl;
break;
default :
cout<<"Anda tidak memilih apa-apa";
}
getch();
}

pendaftaran blog

NAMA : AQIF HUSAEN ABDULLAH
NIM : 11018238
KELAS : D

Hello world!

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.