compute the nth mumber in the fibonacci sequence?
Answer Posted / sweety
main()
{ int a=0,b=1,c,n,i;
printf("enter nth number");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
c=a+b;
printf("fibonacci series is %d",&c);
a=b;
b=c;
}
getch();
}
| Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
How can I write a function analogous to scanf?
Can an array be an Ivalue?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Is linux written in c?
What is nested structure in c?
What is the best organizational structure?
What is the purpose of sprintf?
Why main is not a keyword in c?
What is character constants?
How are structure passing and returning implemented?
How variables are declared in c?
Do pointers need to be initialized?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
What is data type long in c?