Advertisement
therrontelford

Triangle Pattern

Dec 10th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. public class TrianglePattern {
  2.    
  3.     // once I get out of practice I have to diddle
  4.     // with these before I get them right.  So, take heart. Don't be discouraged.
  5.     // play around with the spacing and see what happens
  6.  
  7.     public static void main(String[] args) {
  8.         for (int i=0; i<5; i++){
  9.             for (int j = 4-i; j>0 ;j--){
  10.                 System.out.print(" ");
  11.             }
  12.             for (int k= i+1; k>0; k--){
  13.                 System.out.print("*");
  14.             }
  15.             System.out.println();
  16.         }
  17.        
  18.  
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement