A Java program
// A Java program to read a number and compute and display its square.
public static void main(String arg[]) throws IOException {
BufferedReader stdin = new BufferedReader
(new InputStreamReader (System.in));
System.out.print ("Enter the number to be square: ");
n = Integer.parseInt (stdin.readLine());
System.out.println ("The square of " + n + " is " + n*n);