Question: 1 2 . 1 2 LAB: Number pattern Write a recursive function called PrintNumPattern ( ) to output the following number pattern. Given a positive

12.12 LAB: Number pattern
Write a recursive function called PrintNumPattern() to output the following number pattern.
Given a positive integer as input (Ex: 12), subtract another positive integer (Ex:3) continually until a negative value is reached, and then continually add the second integer until the first integer is again reached. For this lab, do not end output with a newline and there is a space after the last value.
Ex. If the input is:
12
3
the output is:
\(579280.4277042. q \times 3 z q y 7\)
LAB ACTIVITY
12.12.1: LAB: Number pattern
main.cpp
Load default template...
```
#include
using namespace std;
// TODO: Write recursive PrintNumPattern() function
int main(){
int num1;
int num2;
cin >> num1;
cin >> num2;
PrintNumPattern(num1, num2);
}
return 0;
```
When done developing your program, press the Submit for grading button below. This will submit your program for auto-grading.
1 2 . 1 2 LAB: Number pattern Write a recursive

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!