Print Fibonacci series using arrays.
#include
#include
void main()
{
int arr[100],n,i,a,b;
clrscr();
printf("Enter the number of values :");
scanf("%d",&n);
a=0;
b=1;
arr[0]=a;
arr[1]=b;
for(i=2;i
arr[i]=a+b;
a=b;
b=arr[i];
}
for(i=0;i
printf("\n%d",arr[i]);
}
getch();
}
/*Output
Fibonacci Series
Enter no of elements of Fibonacci Numbers :4
1
1
2
3
*/
Shopping In MUMBAI
Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top.
Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.
Tuesday, December 30, 2008
C Program to Print Fibonacci series using arrays.
Posted by ars at 8:47 PM
Subscribe to:
Post Comments (Atom)
2 comments:
the for condition is not filled completely.
thanks...error rectified.
Post a Comment