Materi Perkuliahan PTR - Coding Bintang


Coding Bintang



 public static void main(String[] args) {
    Scanner masuk = new Scanner(System.in);
    int n ;
       
    System.out.print("Masukan Tinggi Bintang : ");
        n = masuk.nextInt();
   
        for (int a = n; a >= 1; a--) {
            for (int b = 1; b <= n-a ; b++) {
                System.out.print(" ");  
            }
            for (int k = a; k >= 1; k--) {
                System.out.print("* ");
               
            }
            System.out.println("");
        }
        // TODO code application logic here
    }
   
}

Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 komentar:

Posting Komentar