Guest User

Untitled

a guest
Jul 15th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Highest
  4. {
  5. static Scanner input = new Scanner( System.in );
  6. public static void main( String args[] )
  7. {
  8. System.out.print( "Number 1: " );
  9.  
  10. // Convert String to integer
  11. int a = Integer.parseInt( input.nextLine() );
  12.  
  13. System.out.print( "Number 2: " );
  14.  
  15. // Convert String to integer
  16. int b = Integer.parseInt( input.nextLine() );
  17.  
  18. // Look what number is the highest
  19. int highest = a < b ? b : a;
  20.  
  21. System.out.println( "Highest number is: " + highest );
  22. }
  23. }
Add Comment
Please, Sign In to add comment