mmayoub

Ex05c 24.04.2021

Apr 27th, 2021
592
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. import java.util.Scanner;
  3.  
  4. // 24.04.2021
  5. public class Ex05c {
  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.print(a);
  19.             System.out.print(", ");
  20.             System.out.println(b);
  21.         } else {
  22.             // false
  23.             System.out.println(b + ", " + a);
  24.         }
  25.  
  26.         in.close();
  27.     }
  28.  
  29. }
  30.  
RAW Paste Data