Thursday, August 25, 2011

Java println example


//This program print "*" in a triangle shape (PrintStar1.java)
public class PrintStar1
{
public static void main(String args[])
{
System.out.println(" *");
System.out.println(" ***");
System.out.println(" *****");
System.out.println(" *******");
System.out.println(" *********");
System.out.println(" ***********");
System.out.println("*************");
}
}

OUT PUT =>
*
***
*****
*******
*********
***********
*************

No comments:

Post a Comment