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
In a byte, what is the maximum decimal number that you can accommodate?
What is a protocol in c?
Explain how can type-insensitive macros be created?
What are different types of pointers?
What is the role of this pointer?
What does char * * argv mean in c?
What does s c mean in text?
What is the equivalent code of the following statement in WHILE LOOP format?
Tell me what are bitwise shift operators?
What is int main () in c?
Can a variable be both static and volatile in c?
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
Is there a way to jump out of a function or functions?
How to implement a packet in C
How do you define a function?