Answer:
See Explanation Below
Step-by-step explanation:
// C++ printNumPattern() recursive method
// Comments are used for explanatory purpose
// Only the recursive is submitted
// Method starts here
void printPattern(int num1, int num2, bool dec)
{
// Print num2.
cout << num2 << " ";
//Printing to num1
if (dec == false && num1 ==num2) {
return; }
// Printing to 0 or negative.
if (dec)
{
// If num2 is greater than num2
if (num2-num1 > 0)
printPattern(num1, num2-num1, true);
else // recur with false dec
printPattern(num1, num2-num1, false);
}
else // If dec is false.
printPattern(num1, num2+num1, false);
}
//End of recursive