Advertisement
myrdok123

02. Greater Number

Mar 16th, 2024
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. package ConditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P02GreaterNumber {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner scanner = new Scanner(System.in);
  9.  
  10.         int num1 = Integer.parseInt(scanner.nextLine());
  11.         int num2 = Integer.parseInt(scanner.nextLine());
  12.  
  13.         if (num1 > num2){
  14.             System.out.println(num1);
  15.         } else {
  16.             System.out.println(num2);
  17.         }
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement