package star;
public class pyramid {
public static void main(String[] args) {
int i,j,k,l;
for(i=0;i<4;i++)
{
for(j=1;j<4-i;j++)
{
System.out.print(" ");
}
for(k=0;k<=i;k++)
{
System.out.print("*");
}
for(l=1;l<=i;l++)
{
System.out.print("*");
}
System.out.print("\n");
}
}
}
public class pyramid {
public static void main(String[] args) {
int i,j,k,l;
for(i=0;i<4;i++)
{
for(j=1;j<4-i;j++)
{
System.out.print(" ");
}
for(k=0;k<=i;k++)
{
System.out.print("*");
}
for(l=1;l<=i;l++)
{
System.out.print("*");
}
System.out.print("\n");
}
}
}
No comments:
Post a Comment