#include <cstdlib>
#include <iostream>
using namespace std;
class kpk
{
public:
void input();
void output();
void proses();
private:
int a,b,c;
int nilai;
};
void kpk::input(){
cout<<"Masukkan Nilai Bil A : "; cin>>a;
cout<<"Masukkan Nilai Bil B : "; cin>>b;
}
void kpk::proses(){
int fpb;
fpb = a%b;
nilai = (a*b)/abs(fpb);
}
void kpk::output()
{
proses();
cout<<"KPK Antara "<<a<<" dan "<<b<<" Adalah "<<nilai<<endl;
}
int main(int argc, char *argv[])
{
kpk bilangan;
bilangan.input();
bilangan.output();
system("PAUSE");
return EXIT_SUCCESS;
}
Tidak ada komentar:
Posting Komentar