compute the nth mumber in the fibonacci sequence?
Answer Posted / manish soni tagore collage jai
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,sum,n,cnt;
printf("Enter the number");
scanf("%d",&n);
for(a=0,b=1,cnt=1;cnt<=n;cnt++)
{
sum=a+b;
printf("%d\t",sum);
a=b;
b=sum;
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why does everyone say not to use scanf? What should I use instead?
Explain how do you search data in a data file using random access method?
What tq means in chat?
how to introdu5ce my self in serco
What is a function in c?
What is the value of h?
Explain what is the difference between null and nul?
Why static is used in c?
What are the disadvantages of c language?
What is sizeof return in c?
Where register variables are stored in c?
Does c have function or method?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
How variables are declared in c?
What is the best way of making my program efficient?