Kalkulator Sederhana Pada Dev C++
berikut Script nya dapat dilihat pada dibawah ini
#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
int n1,n2, tambah, kurang,kali;
float bagi;
cout<<"Masukan nilai 1 :"; cin>>n1;
cout<<"Masukan nilai 2 :"; cin>>n2;
tambah = n1 + n2;
kurang = n1 - n2;
kali = n1 * n2;
bagi = n1 / n2;
cout <<"\n" <<n1<< " + " <<n2<<" = "<<tambah;
cout <<"\n" <<n1<< " - " <<n2<<" = "<<kurang;
cout <<"\n" <<n1<< " x " <<n2<<" = "<<kali;
cout <<"\n" <<n1<< " : " <<n2<<" = "<<bagi;
return 0;
}
0 komentar:
Post a Comment