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
Why isnt there a numbered, multi-level break statement to break out
What is file in c language?
What are the advantages of external class?
#include
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
What is typedef example?
What is size of union in c?
Explain what are preprocessor directives?
What is the difference between the local variable and global variable in c?
Why does the call char scanf work?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
Explain how can I write functions that take a variable number of arguments?
Tell us bitwise shift operators?
What is the heap?
What are different types of variables in c?