#include <iostream.h>
#include <conio.h>
using namespace std;
class fpb {
public:
void input();
void output();
void proses();
private:
int a,b,c;
int nilai;
};
void fpb::input(){
cout<<"Masukkan Nilai Bil A : "; cin>>a;
cout<<"Masukkan Nilai Bil B : "; cin>>b;
}
void fpb::proses(){
int fpb;
fpb = a%b;
nilai = (a*b)/abs(fpb);
}
void fpb::output()
{
proses();
cout<<"FPB Antara "<<a<<" dan "<<b<<" Adalah "<<nilai<<endl;
}
int main(int argc, char *argv[])
{
fpb bilangan;
bilangan.input();
bilangan.output();
system("PAUSE");
return EXIT_SUCCESS;
}
This program serves to find the gcd of numbers with each other
Jumat, 15 April 2011
mencari bilangan FPB
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar