0

I'm trying to make it print out like this
*****
****
***
**
*
but it keeps on coming out like this:
*****
****
***
**
**
here is the code i used

public class Asterisk
{
  public static void main(String[] args)
  {
    for (int i=5; i>0;i--)
    {
      System.out.println("");
       for (int j=1; j<=i;j++)
       {
           System.out.print("*");
       }
    for (int k=5; k<=i; k++)
    {
    }
      }
   System.out.println("*");
   }
}
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by thines01
1
public class Asterisk
{
   public static void main(String[] args)
   {
      for (int i=5; i>0;i--)
      {
         System.out.println("");
         for (int j=1; j<=i;j++)
         {
            System.out.print("*");
         }
      }
   //System.out.println("*");
   }
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.