//In mathamatics, the Fibonacci numbers are the numbers in the following integer sequense:
void main()
{
int Term,i,val3,val1=0,val2=1;
printf("Enter the value for Fibonacci series of nth term := ");
scanf("%d",&Term);
printf("%d %d ",val1,val2);
for(i=0;i<=Term;i++) //logic for fibonacci series
{
val3=val1+val2;
val1=val2;
val2=val3;
printf("%d ",val3);
}
}
No comments:
Post a Comment