/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication48;
import javax.swing.*;
/**
*
* @author Bio
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic
String t = “”;
t = JOptionPane.showInputDialog(“masukkan tinggi segitiganya”);
int tinggi = Integer.parseInt(t);
int baris, kolom;
// membuat 4 baris bintang pertama (naik)
for(baris=1; baris <= tinggi; baris++){
for(kolom=0; kolom 0; baris–){
for(kolom=0; kolom <baris;kolom++)
System.out.print("*");
System.out.println("");
}
}
}