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
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
find out largest elemant of diagonalmatrix
What does %p mean?
What the different types of arrays in c?
What is a static variable in c?
Does c have enums?
Can variables be declared anywhere in c?
Is it better to use malloc() or calloc()?
What is substring in c?
What is && in c programming?
how to execute a program using if else condition and the output should enter number and the number is odd only...
What is bss in c?
What is the use of void pointer and null pointer in c language?
What is bash c?
When should a type cast not be used?