Java input Program

Java input Program













  1. import java.util.Scanner;
  2.  
  3. class So
  4. {
  5.    public static void main(String args[])
  6.    {
  7.       int a,b;
  8.       
  9.     Scanner in = new Scanner(System.in);
  10.      
  11.       System.out.println("Enter an integer");
  12.       a = in.nextInt();
  13.       System.out.println("Square = "+ (a*a));
  14.      
  15.    
  16.    }
  17. }

Output





Comments