Question: (JAVA) Write a program that prompts the user to input a positive integer. It should produce the output shown below when the user input is
(JAVA) Write a program that prompts the user to input a positive integer. It should produce the output shown below when the user input is 5. Use a nested for-loop or a nested while-loop. Extra credit write two versions; one with a for-loop and a second version with while-loop.
* 1
** 2
*** 3
**** 4
***** 5
***** 5
**** 4
*** 3
** 2
* 1
Hint: You can complete the top half with a nested for-loop and the bottom half with another nested for-loop. The variable used to control the outer loop will be the limit for the inner loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
