hey guys im new to recursion to recursion..pls look at the function call ...question is how do i call in two functions at the same time..and which one should i return
thank you.
#include <iostream>
using namespace std;
bool canMakeChange(int total, int nums[], int length){
if(total==0)
return true;
else
canMakeChange(total,nums,length-1);
return canMakeChange(total-nums[length-1],nums,length-1);
}
int main()
{
const int TOTAL = 20;
int coins[4]={10,5,5,10};
if (canMakeChange(TOTAL, coins, 5))
cout<<"true"<<endl;
return 0;
}