Wednesday, March 2, 2016

Display Robot in Java




Write a small Java program that is printing on the screen a ROBOT. You can print whatever form of the robot you want.




import java.io.*;
import java.lang.*;
import java.util.*;
public class Robot
{
public static void main(String[] args)
    {
            System.out.println("Program for displaying pattern of Robot.\n");
         
System.out.print("      ------- \n");
System.out.print("       -   -  \n");
System.out.print("      ------- \n");
System.out.print("         |    \n");
System.out.print("         |    \n");
System.out.print("       / | \\ \n");
System.out.print("         |    \n");
System.out.print("        / \\  \n");
}
}

No comments:

Post a Comment