![subject](/tpl/images/cats/mat.png)
Mathematics, 14.02.2020 16:30 camiilajakobsen1400
Write a recursive method called printNumPattern() to output the following number pattern.
Given a positive integer as input (Ex: 12), subtract another positive integer (Ex: 3) continually until 0 or a negative value is reached, and then continually add the second integer until the first integer is again reached.
Ex. If the input is
12
3
the output is
12 9 6 3 0 3 6 9 12
Code Below:
import java. util. Scanner;
public class NumberPattern {
// TODO: Write recursive printNumPattern() method
public static void main(String[] args) {
Scanner scnr = new Scanner(System. in);
int num1;
int num2;
num1 = scnr. nextInt();
num2 = scnr. nextInt();
printNumPattern(num1, num2);
![ansver](/tpl/images/cats/User.png)
Answers: 3
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Mathematics
![image](/tpl/images/cats/mat.png)
![image](/tpl/images/cats/mat.png)
Mathematics, 21.06.2019 23:30, saintsfan2004
Arestaurant added a new outdoor section that was 8 feet wide and 6 feet long. what is the area of their new outdoor section
Answers: 1
![image](/tpl/images/cats/mat.png)
![image](/tpl/images/cats/mat.png)
Mathematics, 22.06.2019 01:20, ctyrector
Anita has a success rate of 80% on free throws in basketball. she wants to know the estimated probability that she can make exactly four of five free throws in her next game. how can she simulate this scenario? categorize each simulation of this scenario as correct or incorrect.
Answers: 2
You know the right answer?
Write a recursive method called printNumPattern() to output the following number pattern.
Questions in other subjects:
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/istoriya.png)
History, 06.03.2020 17:04
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 06.03.2020 17:05
![Konu](/tpl/images/cats/mat.png)
Mathematics, 06.03.2020 17:05
![Konu](/tpl/images/cats/health.png)
![Konu](/tpl/images/cats/biologiya.png)
![Konu](/tpl/images/cats/obshestvoznanie.png)