class Latihan2
{
public static void main(String[] args)
{
int n = Integer.parseInt(javax.swing.JOptionPane.showInputDialog("Masukkan nilai utk N:"));
for (int i=1; i<=n; i++)
{
for (int j=1; j<=i; j++)
{
System.out.print(i+"*");
}
System.out.println();
}
}
}
{
public static void main(String[] args)
{
int n = Integer.parseInt(javax.swing.JOptionPane.showInputDialog("Masukkan nilai utk N:"));
for (int i=1; i<=n; i++)
{
for (int j=1; j<=i; j++)
{
System.out.print(i+"*");
}
System.out.println();
}
}
}
0 Responses so far.
Post a Comment