compute the nth mumber in the fibonacci sequence?
Answer Posted / dinesh kumar .n
#include<stdio.h>
#include<conio.h>
void main()
{
int a=-1,b=1,c,n,i;
printf("enter the number");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
c=a+b;
printf("%d",c);
a=b;
b=c;
}
getch();
}
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
What do you mean by a sequential access file?
Explain union. What are its advantages?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
Explain the difference between exit() and _exit() function?
What is the modulus operator?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
What is printf () in c?
Why is c fast?
plz let me know how to become a telecom protocol tester. thank you.
what are bit fields in c?
Can we increase size of array in c?
what is the diffrenet bettwen HTTP and internet protocol
How many levels of pointers can you have?
Explain what is the benefit of using const for declaring constants?