import java.io.*; import java.lang.*; class Mul { public static void main(String args[])throws IOException { int n1=0,n2; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter first number "); n1=Integer.parseInt(br.readLine()); System.out.println("Enter second number "); n2=Integer.parseInt(br.readLine()); n1*=n2; // or n1=n1*n2 System.out.println("Multiplication of two numbers is: "+n1); } }
OUTPUT:
Compile: javac Mul.java Run: java Mul Enter first number 10 Enter second number 20 Multiplication of two numbers is: 200