SlideShare a Scribd company logo
1 of 5
2.6 Membuat faktorial dengan komponen Analisis.
 Analisis
Inisialisasi : x  1
y 0
z  0
xy
yz
n  0
Input : bil
Perulangan
Kondisi : n >=bil
Proses : z  x+y
n  n+1
Output : 0, b
ALGORITMA
 Deklarasi
bil : integer (input)
y : integer (output)
 Deskripsi
read (bil)
for(i=0;i>=n)
z  z+ 1
x y
y-z
in n +1
write (y)
Bahasa C++
#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
int x,y,z,bil,n;
x =1;
y =0;
z =0;
cout<<"masukan bilangan"<<endl;
cin >> bil;
n =0;
cout << 0 << endl; while (!(n>=bil))
{
z =x+y;
x =y;
y =z;
n =n+1;
cout << y << endl; }

More Related Content

What's hot (18)

program sederhana
program sederhanaprogram sederhana
program sederhana
 
Linker
LinkerLinker
Linker
 
MFC Text app
MFC Text appMFC Text app
MFC Text app
 
Latihan individu
Latihan individuLatihan individu
Latihan individu
 
c ++ informe Nº5 ucsm
c ++ informe Nº5 ucsmc ++ informe Nº5 ucsm
c ++ informe Nº5 ucsm
 
Luis cuñas programacion
Luis cuñas programacionLuis cuñas programacion
Luis cuñas programacion
 
Ejercicios.
Ejercicios. Ejercicios.
Ejercicios.
 
Yohan jacobi gaussseidel_analisis
Yohan jacobi gaussseidel_analisisYohan jacobi gaussseidel_analisis
Yohan jacobi gaussseidel_analisis
 
Info clasa
Info clasaInfo clasa
Info clasa
 
list program C#
list program C#list program C#
list program C#
 
Scanfill polygon
Scanfill polygonScanfill polygon
Scanfill polygon
 
Prueba de montecarlo
Prueba de montecarloPrueba de montecarlo
Prueba de montecarlo
 
Teknik simulasi
Teknik simulasiTeknik simulasi
Teknik simulasi
 
vecotores programacion
vecotores programacionvecotores programacion
vecotores programacion
 
Tugas kelompok 3.5
Tugas kelompok 3.5Tugas kelompok 3.5
Tugas kelompok 3.5
 
Los fantastico
Los fantasticoLos fantastico
Los fantastico
 
Rafaeltorres
RafaeltorresRafaeltorres
Rafaeltorres
 
Programs
ProgramsPrograms
Programs
 

Kelompok 2.6

  • 1. 2.6 Membuat faktorial dengan komponen Analisis.  Analisis Inisialisasi : x  1 y 0 z  0 xy yz n  0 Input : bil Perulangan Kondisi : n >=bil Proses : z  x+y n  n+1 Output : 0, b
  • 2. ALGORITMA  Deklarasi bil : integer (input) y : integer (output)  Deskripsi read (bil) for(i=0;i>=n) z  z+ 1 x y y-z in n +1 write (y)
  • 3.
  • 4.
  • 5. Bahasa C++ #include <iostream> #include <string> using namespace std; int main() { string raptor_prompt_variable_zzyz; int x,y,z,bil,n; x =1; y =0; z =0; cout<<"masukan bilangan"<<endl; cin >> bil; n =0; cout << 0 << endl; while (!(n>=bil)) { z =x+y; x =y; y =z; n =n+1; cout << y << endl; }