Upper left (n = 5):

*****
****
***
**
*
Lower left (n = 5):

*
**
***
****
*****
More difficult ones:
Hint: you need to print out spaces using System.out.print(" ");
Upper right (n = 5):

*****
 ****
  ***
   **
    *
Lower right (n = 5):

    *
   **
  ***
 ****
*****

This is an example from CSci 1211 course.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.