Tuesday, November 20, 2012

star printing

class Stars
{
    public static void main(String[] args)
    {
   
    for (int r= 1; r<= 5; r++)
    {
    for (int s= 4;s<= r-5; s++)//this for loop is actually not doing anything,so better drop it off....
    {
    System.out.print(" ");
    }
   
    for (int st= 1; st<= 6-r; st++)
    {
        System.out.print("*");
    }
    System.out.println();
    }
}
}

No comments: