Code:
int f(int n)
{
return(0);
if(n==1)
return(1);
printf("ADD");
return(f(n-1)+f(n-2));
}
|
Newbie Member
|
|
| 17Nov2010,02:19 | #1 |
|
C code
Code:
int f(int n)
{
return(0);
if(n==1)
return(1);
printf("ADD");
return(f(n-1)+f(n-2));
}
|
|
Go4Expert Member
|
|
| 17Nov2010,03:30 | #2 |
|
Sorry but your code will stop execution at first line, but I suppose you want to obtain recursive algorithm for n-th Fibbonacci number.
eblack10
like this
|
|
Newbie Member
|
|
| 17Nov2010,20:56 | #3 |
|
That is what I thought. I was argued down that it should compile. Thanks!
|
|
Ambitious contributor
|
|
| 19Nov2010,01:18 | #4 |