Advertisement
Guest User

Untitled

a guest
Jan 4th, 2021
747
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. public class CheckYourIndentation {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner scan = new Scanner(System.in);
  8.        
  9.         System.out.println("Give a number: ");
  10.         int first = Integer.valueOf(scan.nextLine());
  11.         System.out.println("Give another number: ");
  12.         int second = Integer.valueOf(scan.nextLine());
  13.        
  14.         if (first == second) {
  15.             System.out.println("Same!");
  16.         }
  17.         else if (first > second) {
  18.             System.out.println("The first was larger than the second!");
  19.         }
  20.         else {
  21.             System.out.println("The second was larger than the first!");
  22.         }
  23.     }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement