Write a Java program that asks a user to enter an integer from 1 to 50. The program should display like the following figure.
If the user enters 3, the output would be
***
**
*
**
***
Hint:
use nested for-loops; the outside loop controls the number of lines to write and the inside loop controls the number of asterisks to display on a line.
No comments:
Post a Comment