Sunday 16 August 2015

WAP in java to print following pattern of stars.

/*   PATTERN IS-  *
                                **
                                ***
                                ****
                                *****                              */



class Pattern_1 {

public static void main(String args[])
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
System.out.print("*");
System.out.println();
}
}

}

No comments:

Post a Comment