Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

FPB C++

Dafitra Rhizqy Wiwanda 6101804


Indra Kristian Purba 6101001

#include <iostream>

int main( )
{
using std::cout;
using std::cin;
int x,y,z;
cout << "masukkan x:";
cin >> x;
cout << "masukkan y:";
cin >> y;

z=x%y;
if (z!=0)
{
x=y;
y=z;
z=x%y;
}

cout << "FPB: " << y << "\n";

return 0;
}
Flowchart FPB C++

START

Int x,y,z

Tampil masukkan x

Ambil nilai x

Tampil masukkan y

Ambil nilai y

z=x%y

F
z =0 x=y
? y =z

Tampil FPB :

Print y

end

You might also like