ofekkfir

exercise 4

Oct 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class targil4
  5. {
  6.     static Scanner reader = new Scanner(System.in);
  7.     /**
  8.      * @param args
  9.      */
  10.     public static void main(String[] args)
  11.     {
  12.         int x;
  13.         int x2;
  14.         System.out.println ("enter num1");
  15.        
  16.         x = reader.nextInt();
  17.        
  18.         System.out.println ("enter num2");
  19.        
  20.         x2 =reader.nextInt();
  21.         if (x>x2){
  22.             System.out.println(x);
  23.             System.out.println(x2);
  24.         }
  25.         else
  26.         {
  27.             System.out.println(x2);
  28.             System.out.println(x);
  29.         }
  30.        
  31.        
  32.  
  33.     }
  34.  
  35. }
Add Comment
Please, Sign In to add comment