
here they're, the source code and some explanation about the code
#include <cstdlib>
#include <iostream>
using namespace std;
int main ()
{
int x,y,z ;
cout<<"mencari FPB" <<endl;
cout<<"Masukan angka ke 1 = ";
cin>>y;
cout<<"masukan angka ke 2= ";
cin>>z;
while (z !=0)
{
x=y%z;
y=z;
z=x;
}
cout<<"bilangan FPBnya adalah = "<<y<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
Tidak ada komentar:
Posting Komentar