Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Problem1part1 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner keyboard = new Scanner(System.in);
- int age1, age2;
- System.out.println("Enter an age");
- age1 = keyboard.nextInt();
- System.out.println("Enter another age");
- age2 = keyboard.nextInt();
- if (age1 > age2)
- System.out.println("The age of the first entry is greater than the second.");
- else if (age1 < age2)
- System.out.println("The age of the second entry is greater than the first.");
- else
- System.out.println("The two ages are equal.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement