Java program to find product of 2 number

Java program to find product of 2 number

Java program for multiplication

Program:-

import java.util.Scanner;

class group{
public static void main(String ang[]){
Scanner data= new Scanner(System.in);
int num1, num2, prod;
// Read 1st number
System.out.println("Enter 1st number");
num1=data.nextInt();
// Read 2nd number
System.out.println("Enter 2nd number");
num2=data.nextInt();
// Find product
prod=num1*num2;
System.out.println("Product:"+prod);
}
}


Output 1:-

Enter 1st number
5
Enter 2nd number
2
Product:10


Output 1:-

Enter 1st number
589
Enter 2nd number
254
Product:149606


Output 1:-

Enter 1st number
-85
Enter 2nd number
-50
Product:4250


Output 1:-

Enter 1st number
-23
Enter 2nd number
51
Product:-1173





Learn Java:-
Java codes

Java Programs:-
List of Java Programs

Leave reply

Add your comments here

Back to Top