To write a java program to print the Arithmetic operations like Addiction, Subtraction, Division, Remainder of two numbers.
- Import required packages.
- Declare main method with the signature "public static void main(String[] args)".
- Get two numbers as input.
- Perform operations like addition,subtraction,multiplication,division and modulus using the two inputs.
- Print the output on display.
import java.util.Scanner;
public class Ex1
{
public static void main(String[] args)
{
Scanner num = new Scanner(System.in);
System.out.println("Enter two numbers:");
int num1 = num.nextInt();
int num2 = num.nextInt();
System.out.println("Sum of two numbers: "+(num1+num2));
System.out.println("Multiplication of two numbers: "+(num1*num2));
System.out.println("Subtraction of two numbers: "+(num1-num2));
System.out.println("Division of two numbers: "+(num1/num2));
System.out.println("Reminder of two numbers: "+(num1%num2));
}
}
![image](https://private-user-images.githubusercontent.com/93427089/238110991-e0ded2a0-7874-4837-9830-5409af3973a2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxNjI3NjUsIm5iZiI6MTcyMjE2MjQ2NSwicGF0aCI6Ii85MzQyNzA4OS8yMzgxMTA5OTEtZTBkZWQyYTAtNzg3NC00ODM3LTk4MzAtNTQwOWFmMzk3M2EyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI4VDEwMjc0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRjYzZlMGUwMDcwNmVjZTMzODYxM2E4N2E1YzNmODljNWFlZDc3MzUwM2JiMGY2NWMzNTBlY2ZjMGYzOTRkMWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.TkTjdz6uiPMDyBuyKtfzzjiwcxsr-Zm6Awjo64jMRpE)
The java program to print the Arithmetic operations like Addiction, Subtraction, Division, Remainder of two numbers was successfully done.