compute the nth mumber in the fibonacci sequence?
Answer Posted / sree
#include<stdio.h>
#include<conio.h>
void main()
{
int n,a=-1,b=1,c;
printf("Enter n:");
scanf("%d",&n);
for(int i=0;i<=n;i++)
{
c=a+b;
a=b;
b=c;
}
printf("Answer:%d",c);
}
| Is This Answer Correct ? | 9 Yes | 6 No |
Post New Answer View All Answers
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
What is character set?
Write a Program to find whether the given number or string is palindrome.
What are data structures in c and how to use them?
What is the meaning of 2d in c?
What are different storage class specifiers in c?
Which built-in library function can be used to match a patter from the string?
Is null always defined as 0(zero)?
i got 75% in all semester am i eligible for your company
What is floating point constants?
How do you define a string?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
what is the difference between 123 and 0123 in c?
What are derived data types in c?
#include