Program in Java to multiply two numbers
class MultiplyDemo { public static void main(String []args) { java.util.Scanner cin = new java.util.Scanner(System.in); System.out.print("Enter two integer numbers :- "); int x = cin.nextInt(); int y = cin.nextInt(); System.out.println("Multiplication of two integer values = "+(x * y)); System.out.print("\nEnter two floating point numbers :- "); float a = cin.nextFloat(); float b = cin.nextFloat(); System.out.println("Multiplication of two floating point values = "+(a * b)); } }
Output :-
0 Comments