Advertisement
vp0415

Ex8

Oct 5th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Ex8 {
  3.  
  4.     public static void main(String[] args) {
  5.         Scanner input = new Scanner(System.in);
  6.         int x;
  7.         int y;
  8.         System.out.println("Enter first integer: ");
  9.         x = input.nextInt();
  10.         System.out.println("Enter second integer: ");
  11.         y = input.nextInt();
  12.         int sum = x + y;
  13.         System.out.println("The sum is: " + sum);
  14.         int product = x * y;
  15.         System.out.println("The product is: " + product);
  16.         int difference = x - y;
  17.         System.out.println("The difference is: " + difference);
  18.         double quotient = (double)x / (double)y;
  19.         System.out.println("The quotient is: " + quotient);
  20.        
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement