Question: 3.a) Write a recursive method to display the first m multiples of a positive integer n. For example, if n is 2 and m is
3.a) Write a recursive method to display the first m multiples of a positive integer n. For example, if n is 2 and m is 5, it should display 2, 4, 6, 8, 10. As a second example, if n is 3 and m is 6, then it should display 3, 6, 9, 12, 15, 18 (Order doesnt matter). Write a main method that prompts the user to enter a positive integer n and displays as above.
b) Write a recursive method public static void writeVertical(int n) that takes one non-negative integer and displays that integer with the digits going down the screen one per line. For example, the invocation writeVertical(1234) would produce the output 1 2 3 4 Write a main method that prompts the user to enter a positive integer n and displays as above.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
