Saturday, April 12, 2014

Star Printing in Java-06


import java.util.*;
public class Star7
{
public static void main(String args[])
{
for(int row=1;row<=5;row++)
{
for(int s=row;s<=4;s++)
System.out.print(" ");
for(int col=1;col<=2*row-1;col++)
System.out.print("*");
System.out.println();
}
for(int r=1;r<=4;r++)
{
for(int S=1;S<=r;S++)
System.out.print(" ");
for(int c=9-2*r;c>=1;c--)
System.out.print("*");
System.out.println();
}
}
}