c programs coding compile by mingW
Monday, 7 January 2013
Write a program which generates n Fibonacci numbers, where n is given by user. 1 , 1 , 2 , 3 ,5 ,8 ,13 ,21 … n
#include<stdio.h>
void main()
{
int im=1,cant=1,mg,i,oo;
printf("enter limit\n");
scanf("%d",&oo);
for(i=0;i<=oo;i++)
{
mg=im + cant ;
im=b;
cant=d;
printf("%d ",mg);
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment