A JAVA program to show a patterns of stars on the screen.

First make a java project and then make class of name Star and then write down this whole code.

public class Star {


public static void main(String[] args) {
for(int i=1;i<=3;i++)
{
for(int j=3;j>i;j--)
{

System.out.print("");       //to print a blank space
}
for(int k=0;k<i*2-1;i++)
{
System.out.print("*");           // to print asterick*
}
System.out.println();                   // to goto next line
}

}

}
Posted by dany sakhi On Sunday, May 26, 2013 1 comment

1 comment:

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube

Like us