Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

compute the nth mumber in the fibonacci sequence?

Answer Posted / selloorhari

// n th number of a fibonacci series


#include<stdio.h>
#include<conio.h>

void main ()
{
int i,k = 0 , j = 1 ,n,res;
printf ( " \n enter the number " );
scanf ( "%d",&n ) ;

// printf ( "\n the series is 0, 1" ) ;

for ( i= 2 ; i<n;i++ )
{
res= k+j ;
k=j;
j=res;
// printf ( ", %d" ,res ) ;
}
printf ( " \n The n th term is %d " ,res ) ;

getch() ;
}

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can insert comments in a c program?

1070


application attempts to perform an operation?

1917


What is dynamic variable in c?

986


Should a function contain a return statement if it does not return a value?

1017


What are dangling pointers in c?

1119


Define Spanning-Tree Protocol (STP)

1071


What are the different data types in C?

1146


How does #define work?

1011


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

4241


What is #include conio h?

945


What does 1f stand for?

1089


Ow can I insert or delete a line (or record) in the middle of a file?

953


Why is main function so important?

1047


Is anything faster than c?

969


What is the difference between struct and typedef struct in c?

1083