Selasa, 05 April 2016
Kasus 5.6 - Alpro
Dev c++ 5.6
#include <iostream>
#include <string>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
void fibonacci(int n, int f1, int f2, int x){
int f3;
if(x>(n-2))
{
}
else
{
f3=f1+f2;
cout<<f3<<", ";
f1=f2;
f2=f3;
x=x+1;
fibonacci(n,f1,f2,x);
}
}
int main(int argc, char** argv) {
int f1;
int n;
int f2;
int x;
cout<<"Masukkan suku ke-n : ";
cin>>n;
cout<<"fibonacci suku ke-"<<n<<endl;
x=1;
f1=0;
f2=1;
cout<<f1<<", "<<f2<<", ";
fibonacci(n,f1,f2,x);
return 0;
}
Langganan:
Posting Komentar (Atom)
Translate
Popular Posts
Postingan Populer
Label
- Alpro (6)
- Dapodik (1)
- Guru (1)
- Kepegawaian (1)
- Kurikulum merdeka (2)
- Literasi digital (2)
- matrik (1)
- Tendik (1)
Arsip Blog
-
▼
2016
(69)
-
▼
April
(35)
- PROBLEM SOLVING 538
- 4.5.1-4.5.3 HOW TO SOLVE
- 4.6 HOW TO SOLVE
- 4.4 HOW TO SOLVE
- 4.3 HOW TO SOLVE
- 4.2 HOW TO SOLVE
- 4.1 HOW TO SOLVE
- BAB 10
- BAB 9
- BAB 8
- BAB 7
- BAB 3
- BAB 2
- BAB 1 (Diktat)
- BAB 6B (Diktat)
- BAB 6A (Diktat)
- BAB 5 (Diktat)
- BAB 4 (Diktat)
- Kasus 5.8 - Alpro
- Kasus 5.6 - Alpro
- Kasus 5.5 - Alpro
- Kasus 5.4 - Alpro
- Kasus 5.3 - Alpro
- Kasus 5.2 - Alpro
- Kasus 3.5 - Alpro
- Kasus 3.4 - Alpro
- Kasus 3.3 - Alpro
- Kasus 3.2 - Alpro
- Kasus 3.1 - Alpro
- Kasus 2.6 - Alpro
- Kasus 2.3 - Alpro
- Kasus 2.2 - Alpro
- Kasus 4.8 - Alpro
- REFLEKSI MINGGU KE-2
- REFLEKSI MINGGU KE-1
-
▼
April
(35)


Tidak ada komentar:
Posting Komentar