Question: Please answer the question , Thanks. 1. Write a program that prompts the user to enter two integers and display their GCD. The god (m,

Please answer the question , Thanks.
1. Write a program that prompts the user to enter two integers and display their GCD. The god (m, n) can also be defined recursively as follows: a. If men is 0, gcd (m, n) is n b. Otherwise, gcd (m, n) is gcd in, men) Your program should use a recursive method to find the GCD and the output should be displayed as follows: Enter the first integer integer: 17 Enter the second integer: 3 The GCD of 17 and 3 is 1 The program shall begin with the following code: import java.util.Scanner; public class GCD { public static void main(String[] args) { Scanner input = new Scanner(System.in); ........... }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
