Advertisement
mmayoub

Ex05b, 24.04.2021

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