- PROGRAM SEDERHANA FIBONNACI MENGGUNAKAN PERINTAH WHILE
// Taufik Hendriyanto
#include<iostream>
using namespace std;
int main()
{
int x=-1,y=1,z,a,b;
cout<<"MEMBUAT DERET FIBONACCI"<<endl;
cout <<"Masukan Jumlah Deret Nilai =
";cin>>b;
cout <<"\n Bilangan Fibonaccinya adalah = ";
a=1;
while (a<=b)
{
z=x+y;
cout<<z<<ends;
a++;
x=y;
y=z;
}
cout<<"....\n";
}
0 comments:
Post a Comment