LOGO HIMAKA

LOGO HIMAKA
LAMBANG INFORMATIKA

Sunday, April 21, 2013

contoh codingan program fibonacy


#include<iostream.h>
void main()
{
long int a,b,fibo,i,c;
a=1;
b=1;
cout<<"Masukkan jumlah baris : "; cin>>c;
cout<<a<<" "<<b;
for(i=1;i<=c-2;i++)
{fibo=a+b;
cout<<" "<<fibo;
a=b;
b=fibo;
}}

No comments:

Post a Comment