HarrJ

2024 AM 06 Day 06

Jun 25th, 2024 (edited)
566
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Day06C {
  4.     public static void main(String[] args) {
  5.         Scanner uInput = new Scanner(System.in);
  6.         int num1, num2;
  7.        
  8.         System.out.print("Enter num1: ");
  9.         num1 = uInput.nextInt();
  10.         System.out.print("Enter num2: ");
  11.         num2 = uInput.nextInt();
  12.         uInput.close();
  13.        
  14. // add and else if for when both number is the same
  15.         if (num1 > num2) {
  16.             System.out.println(num1 + " is larger");
  17.         } else {
  18.             System.out.println(num2 + " is larger");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment