Coding
Friday, December 20, 2019
febnocii
//febnocii series
#include <stdio.h>
int main()
{
int a=0,b=1,c,i,n;
printf("enter number of elements:");
scanf("%d",&n);
printf("%d %d ",a,b);
for(i=1;i<=n;i++)
{
c=a+b;
printf(" %d ",c);
a=b;
b=c;
}
return 0;
}
No comments:
Post a Comment
Newer Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment