Write a Java program to accept 2 numbers from the user and do addition, subtraction, multiplication, division, modulus calculation by writing methods like..
IN JAVA ONLY!
Answers
Answered by
1
Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the first number:");
int a = sc.nextInt();
System.out.print("Enter the second number:");
int b = sc.nextInt();
System.out.println(a + "+" + b + "=" + (a+b));
System.out.println(a + "-" + b + "=" + (a-b));
System.out.println(a + "*" + b + "=" + (a*b));
System.out.println(a + "%" + b + "=" + (a%b));
System.out.println(a + "/" + b + "=" + (a/(float)(b)));
}
}
Explanation:
Answered by
0
Answer:
I don't know
Explanation:
thanks for point
Similar questions
Math,
8 days ago
Math,
8 days ago
Math,
8 days ago
Political Science,
16 days ago
Business Studies,
16 days ago
Math,
9 months ago
Physics,
9 months ago