SlideShare a Scribd company logo
1 of 6
 Mencari nilai FBP
 Analisis
Input : m,n (integer)
Proses : keciln, kecilm
Proses : rm%p, sn%p, r=0 && s=0
p>=kecil, pp+1
Inisialisasi : p1
Perulangan
Output :"FBPnya :"+t
ALGORITMA
 Deklarasi
m,n : integer (input)
"FBPnya :"+t (output)
 Deskripsi
read (m,n)
rm%p
s n%p
kondisi r=0 && s=0, p>=kecil
p1, pp+1,
write ("FBPnya :"+t )
Bahasa C++
#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
int m,n,t,r,s,p,kecil;
cout<<"masukan m ="<<endl;
cin >> m;
cout<<"masukan n ="<<endl;
cin >> n;
if (m>=n)
{
kecil =n;
}
else
{
kecil =m;
}
p =1;
while (1)
{
r =m % p;
s =n % p;
if (r==0 && s==0)
{
t =p;
}
else
{
}
if (p>=kecil) break;
p =p+1;
}
cout << "FBPnya :"<<t << endl;
return 0;

More Related Content

What's hot

Como crear una matriz de 3x3 con c++ con menu
Como crear una matriz de 3x3 con c++ con menu Como crear una matriz de 3x3 con c++ con menu
Como crear una matriz de 3x3 con c++ con menu JoseGCordero
 
Teknik simulasi
Teknik simulasiTeknik simulasi
Teknik simulasiqoriaini
 
Sujet bac info 2012 g1, g2 et g3 avec correction
Sujet bac info 2012 g1, g2 et g3 avec correctionSujet bac info 2012 g1, g2 et g3 avec correction
Sujet bac info 2012 g1, g2 et g3 avec correctionborhen boukthir
 
Public class c
Public class cPublic class c
Public class conlyhenry
 
Rafael torrest
Rafael torrestRafael torrest
Rafael torrestrfltorres
 
โปรแกรมย่อยและฟังก์ชันมาตรฐาน
โปรแกรมย่อยและฟังก์ชันมาตรฐานโปรแกรมย่อยและฟังก์ชันมาตรฐาน
โปรแกรมย่อยและฟังก์ชันมาตรฐานknangsmiley
 
contoh Program C++ tentang fungsi for
contoh Program C++ tentang fungsi forcontoh Program C++ tentang fungsi for
contoh Program C++ tentang fungsi forM Fahmi Ansori
 
Programación con python
Programación con pythonProgramación con python
Programación con pythonu2014231724
 
Luis cuñas programacion
Luis cuñas programacionLuis cuñas programacion
Luis cuñas programacionluisitofranklin
 
Para la suma y la multiplicacion de 2
Para la suma y la multiplicacion de 2Para la suma y la multiplicacion de 2
Para la suma y la multiplicacion de 2fabiorodriguez123
 
c ++ informe Nº5 ucsm
c ++ informe Nº5 ucsmc ++ informe Nº5 ucsm
c ++ informe Nº5 ucsmIsaac Aquino
 
Matematica discreta recurcividad
Matematica discreta recurcividadMatematica discreta recurcividad
Matematica discreta recurcividadonlyhenry
 

What's hot (20)

Como crear una matriz de 3x3 con c++ con menu
Como crear una matriz de 3x3 con c++ con menu Como crear una matriz de 3x3 con c++ con menu
Como crear una matriz de 3x3 con c++ con menu
 
Java Week7 Notepad
Java Week7   NotepadJava Week7   Notepad
Java Week7 Notepad
 
Kelompok 2.6
Kelompok 2.6Kelompok 2.6
Kelompok 2.6
 
Teknik simulasi
Teknik simulasiTeknik simulasi
Teknik simulasi
 
Sujet bac info 2012 g1, g2 et g3 avec correction
Sujet bac info 2012 g1, g2 et g3 avec correctionSujet bac info 2012 g1, g2 et g3 avec correction
Sujet bac info 2012 g1, g2 et g3 avec correction
 
Public class c
Public class cPublic class c
Public class c
 
Rafael torrest
Rafael torrestRafael torrest
Rafael torrest
 
โปรแกรมย่อยและฟังก์ชันมาตรฐาน
โปรแกรมย่อยและฟังก์ชันมาตรฐานโปรแกรมย่อยและฟังก์ชันมาตรฐาน
โปรแกรมย่อยและฟังก์ชันมาตรฐาน
 
contoh Program C++ tentang fungsi for
contoh Program C++ tentang fungsi forcontoh Program C++ tentang fungsi for
contoh Program C++ tentang fungsi for
 
Programación con python
Programación con pythonProgramación con python
Programación con python
 
Los fantastico
Los fantasticoLos fantastico
Los fantastico
 
Luis cuñas programacion
Luis cuñas programacionLuis cuñas programacion
Luis cuñas programacion
 
Aman
AmanAman
Aman
 
Var
VarVar
Var
 
Mainfinal
MainfinalMainfinal
Mainfinal
 
How
HowHow
How
 
Para la suma y la multiplicacion de 2
Para la suma y la multiplicacion de 2Para la suma y la multiplicacion de 2
Para la suma y la multiplicacion de 2
 
c ++ informe Nº5 ucsm
c ++ informe Nº5 ucsmc ++ informe Nº5 ucsm
c ++ informe Nº5 ucsm
 
Md5
Md5Md5
Md5
 
Matematica discreta recurcividad
Matematica discreta recurcividadMatematica discreta recurcividad
Matematica discreta recurcividad
 

Tugas kelompok 3.3

  • 1.  Mencari nilai FBP  Analisis Input : m,n (integer) Proses : keciln, kecilm Proses : rm%p, sn%p, r=0 && s=0 p>=kecil, pp+1 Inisialisasi : p1 Perulangan Output :"FBPnya :"+t
  • 2. ALGORITMA  Deklarasi m,n : integer (input) "FBPnya :"+t (output)  Deskripsi read (m,n) rm%p s n%p kondisi r=0 && s=0, p>=kecil p1, pp+1, write ("FBPnya :"+t )
  • 3.
  • 4.
  • 5. Bahasa C++ #include <iostream> #include <string> using namespace std; int main() { string raptor_prompt_variable_zzyz; int m,n,t,r,s,p,kecil; cout<<"masukan m ="<<endl; cin >> m; cout<<"masukan n ="<<endl; cin >> n; if (m>=n) { kecil =n; } else { kecil =m; } p =1;
  • 6. while (1) { r =m % p; s =n % p; if (r==0 && s==0) { t =p; } else { } if (p>=kecil) break; p =p+1; } cout << "FBPnya :"<<t << endl; return 0;