Advertisement
Guest User

PrintTriangle2

a guest
Feb 18th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public class PrintTriangle2
  2. {
  3. public static void main(String[] args)
  4. {
  5. int size = 6;
  6. int count = size;
  7.  
  8. for (int x = 1; x <= count; x++) {
  9. for (int y = 1; y < x; y++) {
  10. System.out.print(" ");
  11. }
  12.  
  13. for (int i = 1; i <= size; i++) {
  14. System.out.print("# ");
  15. }
  16. size--;
  17. System.out.println();
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement