Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public static void showPyramid(int level)
  2. {
  3. for(int i=0;i<level;i++)
  4. {
  5. for(int j=0;j<level-i-1;j++)
  6. {
  7. System.out.print(" ");
  8. }
  9. for(int k=level-i;k<=level;k++)
  10. {
  11. System.out.print("*");
  12. }
  13. for(int k=level-i;k<level;k++)
  14. {
  15. System.out.print("*");
  16. }
  17. for(int j=0;j<level-i;j++)
  18. {
  19. System.out.print(" ");
  20. }
  21.  
  22. System.out.print("\n");
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement