Answer to Question #252903 in Java | JSP | JSF for Olwam

Question #252903
Using a loop structure, write a Java program called Shape to create the pattern below:
******
*****
****
***
**
*
1
Expert's answer
2021-10-18T08:32:19-0400
public class Shape {
 public static void main(String[] args) {
  for (int i = 0; i < 5; i++) {
   for (int j = 0; j < 5 - i; j++) {
    System.out.print('*');
   }
   System.out.println();
  }
 }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS