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
What is external variable in c?
What is the difference between functions abs() and fabs()?
what are # pragma staments?
Why is sprintf unsafe?
What tq means in chat?
How we can insert comments in a c program?
What are the two types of functions in c?
Can we increase size of array in c?
Why is C language being considered a middle level language?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
Explain the difference between the local variable and global variable in c?
When is a “switch” statement preferable over an “if” statement?
What are c header files?
Is python a c language?
Give the rules for variable declaration?