Answer to Question #18537 in Java | JSP | JSF for zyrus santillan

Question #18537
Write a java source code that would compute the 4 arithmeti operators such as addition, subtraction,difference, and qoutient of the two given number. input the firrst number and second number named it as NUM1 and NUM2 and display the PRODUCT,DIFFERENCE,QUOTIENT, SUM of the two numbers
1
Expert's answer
2012-11-12T12:38:17-0500
import java.util.Scanner;


public class Calc {


public static void main(String[] args) {
& Scanner scan = new Scanner(System.in);
& System.out.print("Input NUM1 :");
& int NUM1 = scan.nextInt();
& System.out.print("Input NUM2 :");
& int NUM2 = scan.nextInt();
& System.out.println("SUM = "+(NUM1+NUM2));
& System.out.println("DIFFERENCE = "+(NUM1-NUM2));
& System.out.println("QUOTIENT = " + (NUM1 / NUM2));
& System.out.println("PRODUCT = " + (NUM1 * NUM2));
&
}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS