About

Wednesday, 18 January 2012

Program Fibonacci

#include <iostream.h>
#include<conio.h>
main()
{
int x=1,y=1,p,i,a;
clrscr();
cout<<"Masukkan batas deret fibonacci : ";
cin>>a;
cout<<x<<" ";
cout<<y<<" ";
for(i=0;i<=a-3;i++)
{
p=x+y;
cout<<p<<" ";
x=y;
y=p;
}
getch();
return 0;
}

Baca Juga Artikel dibawah ini :

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons