Advertisement
wadkat

4basicmath java

May 14th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package javaapplication2;
  6. import java.util.Scanner;
  7.  
  8.  
  9. public class proj3 {
  10. public static void main(String[] args)
  11. {
  12. Scanner keyboard = new Scanner(System.in);
  13. int num1, num2, num3, sum, diff, quo, prod;
  14. System.out.print("Enter num1:");
  15. num1 = keyboard.nextInt();
  16. System.out.print("Enter num2:");
  17. num2 = keyboard.nextInt();
  18.  
  19.  
  20. sum = num1+num2;
  21. diff = num1-num2;
  22. quo = num1/num2;
  23. prod = num1*num2;
  24. System.out.println("Sum=" +sum);
  25. System.out.println("Difference=" +diff);
  26. System.out.println("Quotient=" +quo);
  27. System.out.println("Product=" +prod);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement