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 / theredplanethavoc

#include<stdio.h>
#include<conio.h>
void main()
{
int a=0,b=1,c,n,i;
clrscr();
printf("Enter n:");
scanf("%d",&n);
printf("The fibonacci sequence is as follows : \n");
for(i=1;i<=n;i++)
{
c=a+b;
printf("%d ",c);
a=b;
b=c;
}
printf("The nth number in the fibonacci sequence is : %d",c);
getch();
}

Is This Answer Correct ?    25 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I came across some code that puts a (void) cast before each call to printf. Why?

1215


Is void a keyword in c?

986


which is an algorithm for sorting in a growing Lexicographic order

1798


What are nested functions in c?

1011


please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com

1766


Can we access the array using a pointer in c language?

1043


Explain logical errors? Compare with syntax errors.

1068


How to write a code for reverse of string without using string functions?

2137


Write a program to use switch statement.

1125


how to write optimum code to divide a 50 digit number with a 25 digit number??

3264


What is maximum size of array in c?

1032


Explain the use of fflush() function?

1075


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1222


What is call by reference in functions?

1433


In a byte, what is the maximum decimal number that you can accommodate?

1135