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...

write a program for fibonaci series by using while loop in c?

Answer Posted / shamantha

main()
{
int a=0,b=1,c,n;
printf("enter n value");
scanf("%d",&n);
Printf("%d%d",a,b);
while(n-2>0)
{
c=a+b;
printf("%d",c);
a=b;
b=c;
n=n+1;
}
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c have circular shift operators?

1260


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

1035


Explain zero based addressing.

1042


What is c basic?

1186


What is typedef example?

1197


What is the maximum no. of arguments that can be given in a command line in C.?

1158


How can I ensure that integer arithmetic doesnt overflow?

1179


What is the difference between %d and %i?

1105


Why is it usually a bad idea to use gets()? Suggest a workaround.

1798


What is wrong with this code?

1192


Write a program to find the biggest number of three numbers in c?

1051


What is the difference between new and malloc functions?

1138


Can we use visual studio for c?

1106


Can the size of an array be declared at runtime?

1092


How do you generate random numbers in C?

1205