Computer Science, asked by banunaseema627, 5 months ago

write a program in Java to accept two integer values and use those values for a printing addition and multiplication​

Answers

Answered by mpatilrajaram1997
1

Answer:

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

class Addmultwonumber {

public static void main(String[] args) {

int x, y, sum,mul;

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

System.out.println("Type a number:");

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

System.out.println("Type another number:");

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

sum = x + y; // Calculate the sum of x + y

mul = x * y; // Calculate the multiplication

System.out.println("Sum is: " + sum); // Print the sum

System.out.println("Product is: " + mul); //print the multiplication value

}

}

Explanation:

hope this is helpful please mark as brain list and follow me for more solution

Similar questions