tuliskan coding seperti berikut :
public class bintang {
public bintang() {
}
public static void main(String[] args) {
int i=1,j=5,k=1,l,m;
System.out.println();
while (i<=7)
{
if (i<=3)
{
l=1;
m=1;
while (j>=l){System.out.print(" "); l++;}
while (k>=m){System.out.print(" *"); m++;}
System.out.println();
i++;
j--;
k=k+2;
}
else
{
l=1;
m=1;
while (j>=l){System.out.print(" "); l++;}
while (k>=m){System.out.print(" *"); m++;}
System.out.println();
i++;
j++;
k=k-2;
}
}
}
}
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar