Shopping In MUMBAI

Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top. Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.

Wednesday, December 31, 2008

C Program using function to compute the Fibonacci series recursively

Write a function to compute the Fibonacci series recursively. Also write a
main() function to use it.

#include
#include
unsigned fibo(unsigned num)
{
if(num==0)
return 0;
else if(num==1)
return 1;
else return fibo(num-1)+fibo(num-2);
}
int main()
{
unsigned user_range,i;
clrscr();
printf("\t Fibonacci Series");
printf("\n\nEnter The Range For Fibonacci NO.:\n\n");
scanf("%u",&user_range);
for(i=0;i printf("\n%u",fibo(i));
getch();
return 0;
}

/*Output
Fibonacci Series

Enter The Range For Fibonacci NO.:

5

0
1
1
2
3
*/

C Program using function to compute the Fibonacci series recursivelySocialTwist Tell-a-Friend

0 comments:

SUPPORT THIS BLOG