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("*");
   }
}
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("*");
   }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.