SHARE
TWEET

PrintTriangle2

a guest Feb 18th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top