Senin, 21 November 2011

Program C++ Aritmatika

#include <iostream.h>
#include <conio.h>
void main()
{
int a,b;
float kali,tambah,bagi,kurang;
cout<<"silahkan anda input terlebih dahulu angka yang di hitung " <<endl<<endl;
cout<<"nilai Pertama = ";
cin>>a;
cout<<"nilai ke dua  = ";
cin>>b;
tambah=a+b;
bagi=a/b;
kali=a*b;
kurang=a-b;
cout<<endl;

cout<<"hasil a+b = "<<tambah<<endl;
cout<<"hasil a/b = "<<bagi<<endl;
cout<<"hasil a*b = "<<kali<<endl;
cout<<"hasil a-b = "<<kurang<<endl;
getch();
}

0 komentar:

Posting Komentar