Selasa, 10 Mei 2011

BINTANG -4 WITH JAVA

CODDING 

 import javax.swing.*;
public class tugas_bintang4 {
    public static void main (String[]args){
        int baris;
baris=Integer.valueOf(JOptionPane.showInputDialog("Masukan banyak bintang?"));

    for (int i=1;i<=baris;i++)  {
               for (int j=1;j<=baris;j++) {
                   if (i<=j)
                   System.out.print("*");
                   else
                   System.out.print(" ");
               }
               System.out.println();
        }
    }
}


OUTPUT 

0 komentar:

 
blog design by suckmylolly.com