Write a program to accept any two integers to A and B and print the result of the following: A+B,
A-B, A/B, and A*B.
Answers
Answered by
1
Answer:
import java.util.*;
public class ArthmeticalOperation
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int a,b,add,subtract,divide,product;
System.out.println("Enter the numbers");
a=in.nextInt();
b=in.nextInt();
add=a+b;
subtract=a-b;
divide=a/b;
product=a*b;
System.out.println("A+B="+add);
System.out.println("A-B="+subtract);
System.out.println("A/B="+divide);
System.out.println("A*B="+product);
}
}
Similar questions