ar_one_to. Diberdayakan oleh Blogger.
RSS

mencari FPB (Factor Persekutuan Terbesar)


                                       FPB (Faktor Persekutuan Terbesar)
Determining Algorithm gcd Of Numbers such as A & B:
1. Start
2. Enter the number of A & B
3. If the number A is smaller than the number B, A and B exchange
4. If A modulus B = 0, gcd is B, if not to step 3
5. A = B, and B = A modulus B, return to step 3 print results
6. completed

Here is a sample source code c + + about
faktor persekutuan terbesaar atau FPB :

#include
int main()
{
int a,b,x;
cout << "
enter the first number : ";
cin >> a;
cout << "enter the second number : ";
cin >> b;
x = a%b;
while (x!=0)
{
a = b;
b = x;
x = a%b;
}
cout << "Faktor Persekutuan Terbesar adalah : " <
cin>>b;
return 0;
}
Nach….. finished nand simple program that can search for numbers gcd ... hehehe
Pay attention and understand source code and the language used in this program, hopefully can add to knowledge about programming.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 komentar:

Posting Komentar