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

Is a house a mass structure?

1152


What is the mean of function?

1191


What is character constants?

1229


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1991


Explain what is the difference between #include and #include 'file' ?

1079


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1258


Can we access array using pointer in c language?

1127


What is the default value of local and global variables in c?

1099


if p is a string contained in a string?

1890


What is the value of c?

1130


Explain what is a 'locale'?

1127


What is the use of header?

1141


what are non standard function in c

1969


Is fortran still used today?

1148


Write a program which returns the first non repetitive character in the string?

1171