wap to multply of fabonacci series form 1 to n .
#include<stdio.h>
#include<conio.h>
main ()
{
int i,n,prev1=1,prev2=2,mul;
printf("enter the fabonacci series :");
scanf("%d",&n);
printf("%d %d ",prev1 , prev2);
for (i=1;i<=(n-2);i++)
{
mul = prev1 * prev2;
printf(" %d ", mul);
prev1=prev2;
prev2=mul;
}
}
output :
enter the fabonacci series :7
1 2 2 4 8 32 256
Comments
Post a Comment