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

#include<stdio.h>
#include<conio.h>
void main()
{
int n,a=-1,b=1,c;
printf("Enter n:");
scanf("%d",&n);
for(int i=0;i<=n;i++)
{
c=a+b;
a=b;
b=c;
}
printf("Answer:%d",c);
}

Is This Answer Correct ?    9 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

1175


What is character set?

1219


Write a Program to find whether the given number or string is palindrome.

1342


What are data structures in c and how to use them?

1222


What is the meaning of 2d in c?

1170


What are different storage class specifiers in c?

1139


Which built-in library function can be used to match a patter from the string?

1352


Is null always defined as 0(zero)?

1179


i got 75% in all semester am i eligible for your company

2268


What is floating point constants?

1196


How do you define a string?

1152


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2310


what is the difference between 123 and 0123 in c?

1278


What are derived data types in c?

1134


#include #include struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

6402