Home » » Pattren

Pattren

Written By Basith on Sunday, February 24, 2013 | 11:03 PM



public class Stars
{
//-------------------------------------------
//Prints a triangle shape using asterick (star) characters.
//-----------------------------------------------------------
public static void main (String[] args)
{
final int MAX_ROWS = 10;

for (int row = 1; row <= MAX_ROWS; row++)
{
for (int star = 1; star <= row; star++)
System.out.print ("*");

System.out.println();
}
}
}

0 comments:

Post a Comment

Followers