Berikut List program C++ membuat kalkulator sederhana
List Program
#include "stdafx.h"
#include "iostream"
using std::cout;
using std::cin;
#include "string"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char input;
int c,a,b;
cout<<"____________________\n";
cout<<"Kalkulator Sederhana\n";
cout<<"____________________\n\n";
cout<<"1.Perkalian\n\n";
cout<<" Input Nilai Pertama : ";cin>>a;
cout<<" Input Nilai Kedua : ";cin>>b;
c=a*b;
cout<<" Hasil Perkalian : "<<c<<"\n\n";
cout<<"2.Penjumlahan\n\n";
cout<<" Input Nilai Pertama : ";cin>>a;
cout<<" Input Nilai kedua : ";cin>>b;
c=a+b;
cout<<" Hasil Penjumlahan : "<<c<<"\n\n";
cout<<"3.Pembagian\n\n";
cout<<" Input Nilai Pertama : ";cin>>a;
cout<<" Input Nilai Kedua : ";cin>>b;
c=a%b;
cout<<" Hasil Pembagian : "<<c<<"\n\n\n";
cout<<"4.Pengurangan\n\n";
cout<<" Input Nilai Pertama : ";cin>>a;
cout<<" Input Nilai Kedua : ";cin>>b;
c=a-b;
cout<<" Hasil Pengurangan : "<<c<<"\n\n\n";
cin>>input;
return 0;
}
Output
No comments:
Post a Comment
silahkan masukan kritikan yang membangun