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

How can I change the size of the dynamically allocated array?

1092


What does char * * argv mean in c?

999


Write a program with dynamically allocation of variable.

1068


What are the types of variables in c?

979


Write a program to find factorial of a number using recursive function.

1066


What are data types in c language?

1012


What is the use of getchar() function?

1074


How can I sort more data than will fit in memory?

1042


What is the purpose of ftell?

1034


Which is better oop or procedural?

988


How can you increase the allowable number of simultaneously open files?

1090


What is const volatile variable in c?

982


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

975


Should I learn data structures in c or python?

976


Is it possible to initialize a variable at the time it was declared?

1173