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
How do I use strcmp?
What is the best way of making my program efficient?
What is typedef struct in c?
What is the use of bit field?
write a program for the normal snake games find in most of the mobiles.
How do you use a pointer to a function?
What does 4d mean in c?
What is the difference between c &c++?
What is the use of gets and puts?
What is data structure in c language?
What's a good way to check for "close enough" floating-point equality?
Where we use clrscr in c?
When should volatile modifier be used?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none