Here is a recursive function that out puts numbers in an ascending order. I'm supposed to add all the numbers up in a new function below:Code:void countup(int num) { if (num >= 0) { countup(num - 1); cout << num << " "; } else cout << endl; }
However, this doesn't work. Please help me.Code:int sumdown(int num) { int sum = 0; if (num >= 0) { sum+=sumdown(num - 1); } else cout << endl; return(sum); }