Problem:
Write an application that prints the outline of a tree using asterisk
(*) characters.
(*) characters.
Output:
Not available.
Solution:
public class Diamond
{
//-----------------------------------------------------------------
// Prints a diamond
//-----------------------------------------------------------------
public static void main (String args[])
{
System.out.println("Shine bright like a diamond!");
System.out.println(" *");
System.out.println(" ***");
System.out.println(" *****");
System.out.println(" *******");
System.out.println("*********");
System.out.println(" *******");
System.out.println(" *****");
System.out.println(" ***");
System.out.println(" *");
}
}
No comments :
Post a Comment