- Back to Home »
- C++ , Computer , Education , Technology »
- Bilangan Baris Fibonacci C++
March 04, 2013
#include <iostream.h>
#include <conio.h>
main(void)
{
int a, b, c, x, n, i;
cout<<"Bilangan1 ";
cin>>a;
cout<<"Bilangan2 ";
cin>>b;
cout<<"Panjangderet ";
cin>>c;
cout<<endl<<"Deret fibonacci "<<a<<" , "<<b<<" , ";
for(i=0;i<=c-3;i++)
{n=a+b;
a=b;
b=n;
cout<<n<<" , ";}
getch();
}
Don't forget your comment, thanks...