compute the nth mumber in the fibonacci sequence?
Answer Posted / d. prashant
#include<stdio.h>
#include<conio.h>
void main()
{
int a =0,b=1,c,i=2,n;
clrscr();
printf("Enter N Value : ");
scanf("%d",&n);
printf("%d\t%d\t",a,b);
while(n>i)
{
c = a+b;
printf("%d\t",c);
c=b;
b=a;
i++;
}
getch();
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
How to compare array with pointer in c?
Explain modulus operator.
Why static variable is used in c?
What is #ifdef ? What is its application?
What is difference between constant pointer and constant variable?
What is the use of structure padding in c?
Do you know null pointer?
What are the advantages of the functions?
Describe the order of precedence with regards to operators in C.
What is the importance of c in your views?
please give me some tips for the placement in the TCS.
What is exit() function?
What does *p++ do? What does it point to?
Why is c still so popular?
What does. int *x[](); means ?