#include<iostream>
using namespace std;
main()
{
int a=0, b=1, c, n=12, i;
cout<<" Nama : TRISNA AYU SILVIA "<<endl;
cout<<" Nim : 191011400047 "<<endl;
cout<<" Mata Kuliah : Algoritma & Pemrograman 2 "<<endl<<endl;
cout<<"Fibonacci : "<<a<<" "<<b<<" ";
while(i<=n-3)
{
c=a+b;
a=b;
b=c;
cout<<c<<" ";
}
}
Tidak ada komentar:
Posting Komentar