#include
int main()
{
int bil1, bil2, sisa_bagi;
cout<<"Nama : afit miranto\n";
cout<<"NPM : G1D009001\n";
cout<<"Prodi: Teknik Elektro\n\n";
cout<<"Program Mencari FPB\n\n";
cout << "Masukan Bilangan 1 : ";
cin >> bil1;
cout << "Masukan Bilangan 2 : ";
cin >> bil2;
sisa_bagi = bil1 % bil2;
while(sisa_bagi != 0)
{
bil1 = bil2;
bil2 = sisa_bagi;
sisa_bagi = bil1 % bil2;
}
cout<< "FPB : " << bil2 << endl;
return 0;
}
Categories:
program bahasa c
0 comments:
Post a Comment