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


Please Help Members By Posting Answers For Below Questions

Is c compiled or interpreted?

670


What are the types of type qualifiers in c?

652


Explain do array subscripts always start with zero?

763


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

656


How do you determine whether to use a stream function or a low-level function?

657






When was c language developed?

706


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2061


How can you draw circles in C?

631


What are different storage class specifiers in c?

623


how can use subset in c program and give more example

1507


What is the value of h?

597


Is there any data type in c with variable size?

636


What are the advantages of using Unions?

644


What is an expression?

660


Explain is it valid to address one element beyond the end of an array?

739