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 need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

1950


What are structural members?

1018


What do you mean by command line argument?

1183


Tell me the use of bit field in c language?

1071


What are bitwise shift operators in c programming?

1090


How arrays can be passed to a user defined function

1028


Explain #pragma statements.

1058


Explain how can you tell whether two strings are the same?

1020


If the size of int data type is two bytes, what is the range of signed int data type?

1028


Is stack a keyword in c?

1094


How do you use a 'Local Block'?

1176


Explain the use of function toupper() with and example code?

1138


Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

1130


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

6876


Why header file is used in c?

1097