Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Unequal {
- static Scanner sc = new Scanner(System.in);
- public static void main(String[] args) {
- int x;
- int y;
- int z;
- int a;
- System.out.println("Please input a number: ");
- x = sc.nextInt();
- System.out.println("Please input another number: ");
- y = sc.nextInt();
- if (x != (y)) {
- System.out.println(x +" is a different number than " + y); }
- System.out.println("Would you like me to add those numbers together?");
- a = (x + y);
- z = sc.nextInt();
- if (z == 0) {
- System.out.println(x + "+" + y + " = " + a );
- }
- else
- System.out.println("Never mind...");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement