Computer Science, asked by nandinichaudhary1912, 16 days ago

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 samarthkrv
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 jagjitjgt
0

Answer:

I don't know

Explanation:

thanks for point

Similar questions