Program for Multiplication of two input number using 'Java'.

import java.util.Scanner; // Import the Scanner class

class multiplication {

  public static void main(String[] args) {

    int x, y, mul;

    Scanner sc = new Scanner(System.in); // Create a Scanner object

    System.out.println("Enter first number:");

    x = sc.nextInt(); // Read user input


    System.out.println("Enter second number:");

    y = sc.nextInt(); // Read user input


    mul = x * y;  // Calculate the multiplication of x * y

    System.out.println("Multiplication of entered number is: " + mul); // Print the result

  }

Popular posts from this blog

When a method in a subclass overrides a method in superclass, it is still possible to call the overridden method using super keyword - Hacker Rank Solution.

Java's System.out.printf function can be used to print formatted output. The purpose of this exercise is to test your understanding of formatting output using printf. To get you started, a portion of the solution is provided for you in the editor; you must format and print the input to complete the solution.