i am a sucker at this....can anyone tell me where the 30 comes from in the output for this function.not where but why i dont get it...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
int Test(int a, int b)
{
cout<<a<<" "<<b<<endl;
if (a==b)
return a;
elseif ( (a+2) == b)
return a + Test(a+1,b-2);
elsereturn b + Test(a+1,b-2);
}
int main ( ) {
cout<<Test(6,12);
return 0;
}