Question: java question Write a program that prompts the user to enter 3 integers and displays the greatest common divisor of these three numbers. The greatest
java question
Write a program that prompts the user to enter 3 integers and displays the greatest common divisor of these three numbers. The greatest common divisor will be the largest positive integer that divides all three numbers without leaving a remainder. If any of the parameter numbers is less than or equal to zero, then the program should print -1.
For example:
| Input | Result |
|---|---|
12 12 24 | Enter a number1: Enter a number2: Enter a number3: The greatest common divisor is: 12 |
0 12 12 | Enter a number1: Enter a number2: Enter a number3: The greatest common divisor is: -1 |
Write a program which prompts the user to a number of rows and a number of columns. The program prints a parallelogram star pattern. Note: you can assume that the two numbers will always be positive (i.e. greater than 1).
For example:
| Input | Result |
|---|---|
5 5 | Enter number of rows: Enter number of columns: ***** ***** ***** ***** ***** |
6 3 | Enter number of rows: Enter number of columns: *** *** *** *** *** *** |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
