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

Can you explain the four storage classes in C?

1170


What is a ternary operator in c?

1180


How do you write a program which produces its own source code as output?

1175


What are formal parameters?

1176


With the help of using classes, write a program to add two numbers.

1085


What are keywords in c with examples?

1153


What is the size of enum in bytes?

1136


How many keywords (reserve words) are in c?

1194


What is getche() function?

1090


Explain how can I avoid the abort, retry, fail messages?

1107


What does the file stdio.h contain?

1119


What does == mean in texting?

1395


What is main () in c language?

1187


What are the primitive data types in c?

1135


Is printf a keyword?

1261