Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Ex8 {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int x;
- int y;
- System.out.println("Enter first integer: ");
- x = input.nextInt();
- System.out.println("Enter second integer: ");
- y = input.nextInt();
- int sum = x + y;
- System.out.println("The sum is: " + sum);
- int product = x * y;
- System.out.println("The product is: " + product);
- int difference = x - y;
- System.out.println("The difference is: " + difference);
- double quotient = (double)x / (double)y;
- System.out.println("The quotient is: " + quotient);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement