Guest User

Untitled

a guest
Aug 1st, 2019
720
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. /*
  2.  
  3.  * To change this license header, choose License Headers in Project Properties.
  4.  
  5.  * To change this template file, choose Tools | Templates
  6.  
  7.  * and open the template in the editor.
  8.  
  9.  */
  10.  
  11. package bintang;
  12.  
  13.  
  14.  
  15. /**
  16.  
  17.  *
  18.  
  19.  * @author Maswanul Dwi M
  20.  
  21.  */
  22.  
  23.   import java.util.Scanner;
  24.  
  25. public class Bintang {
  26.  
  27.  
  28.  
  29.     /**
  30.  
  31.      * @param args the command line arguments
  32.  
  33.      */
  34.  
  35.  
  36.  
  37.     public static void main(String[] args) {
  38.  
  39.         Scanner input = new Scanner (System.in);
  40.  
  41.         int n;
  42.  
  43.         System.out.print("Masukkan Tinggi Bintang : ");
  44.  
  45.         n = input.nextInt();
  46.  
  47.      
  48.  
  49.         for (int i = 1; i <= n; i++) {
  50.  
  51.          
  52.         for (int j = 1; j <= i; j++) {
  53.  
  54.          
  55.             //for (int i = n; i >= 1; i--) {
  56.  
  57.          
  58.         //for (int j = i; j >= 1; j--) {
  59.  
  60.  
  61.         System.out.print("*");
  62.  
  63.  
  64.         }
  65.  
  66.          System.out.println();
  67.  
  68.         }
  69.  
  70.     }
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment