* *** ***** ******* *********
public class StarPattern8
{
public static void main(String[] args)
{
for (int i=1; i<=5; i++)
{
for(int j=4; j>=i; j--)
{
System.out.print(" ");
}
for (int k=1; k<=i; k++)
{
System.out.print("*");
}
for(int l=2; l<=i; l++)
{
System.out.print("*");
}
System.out.println();
}
}
}
public class StarPattern8
{
public static void main(String[] args)
{
for (int i=1; i<=5; i++)
{
for(int j=4; j>=i; j--)
{
System.out.print(" ");
}
for (int k=1; k<=(2*i-1); k++)
{
System.out.print("*");
}
System.out.println();
}
}
}
Your feedback helps us grow! If there's anything we can fix or improve, please let us know.
Weโre here to make our tutorials better based on your thoughts and suggestions.