Advertisement
mmayoub

Ex05a, 24.04.2021

Apr 27th, 2021
779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. // 24.04.2021
  4. public class Ex05a {
  5.  
  6.     public static void main(String[] args) {
  7.         // TODO Auto-generated method stub
  8.         Scanner in = new Scanner(System.in);
  9.         double a, b;
  10.  
  11.         System.out.println("Enter two numbers: ");
  12.         a = in.nextDouble();
  13.         b = in.nextDouble();
  14.  
  15.         if (a > b) {
  16.             // true
  17.             System.out.println(a);
  18.  
  19.         } else {
  20.             // false
  21.             System.out.println(b);
  22.         }
  23.  
  24.         in.close();
  25.     }
  26.  
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement