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
What are the advantages of using linked list for tree construction?
What are compound statements?
What is an auto keyword in c?
When is a null pointer used?
Does c have function or method?
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
Difference between linking and loading?
What is the purpose of the statement: strcat (S2, S1)?
What is string concatenation in c?
What are the data types present in c?
What is floating point constants?
Explain the priority queues?
#include
Explain what is the heap?
Why is #define used?