Sunday, November 6, 2011

Deret Bintang

import javax.swing.JOptionPane;
public class SegitigaDeretBalik {
public static void main (String [] args){

int n;//deklarasi variable
int c=0;
String k=JOptionPane.showInputDialog("masukkan bilangan");
n= Integer.parseInt(k);

for(int i=1;i<=n;i++)
{
for(int j=i;j>=1;j--)
{

System.out.print("*");
}
System.out.print("\n");
}
}
}

No comments:

^_^

SEMOGA BERMANFAAT