#include <iostream>
#include <stdio.h>
#include <conio.h>
using namespace std;
class c{
public :
matika();
void input();
void proses();
private :
int a,b,hasil;
};
c::matika(){
cout<<"Program kita\n\n\n";
}
void c::input(){
cout<<"Masukan nilai pertama : ";
cin>>a;
cout<<"Masukan nilai kedua : ";
cin>>b;
cout<<"-----------------------------------------------\n\n";
}
void c::proses(){
cout<<"HASIL OPERASI-OPERASI ARITMATIKA"<<endl;
hasil=a+b;
cout<<a<<"+"<<b<<"= "<<hasil<<endl;
hasil=a-b;
cout<<a<<"-"<<b<<"= "<<hasil<<endl;;
hasil=a*b;
cout<<a<<"*"<<b<<"= "<<hasil<<endl;;
hasil=a/b;
cout<<a<<":"<<b<<"= "<<hasil<<endl;;
}
int main(){
c o;
o.input();
o.proses();
return 0;
}
Tidak ada komentar:
Posting Komentar