Guest User

Untitled

a guest
Jan 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. import java.util.*;
  2. public class MinMax{
  3. public static int myMin(int x, int y){
  4. return x < y ? x : y;
  5. }
  6. public static int myMax(int x, int y){
  7. return x > y ? x : y;
  8. }
  9. public static void main(String[] args){
  10. Scanner input = new Scanner(System.in);
  11. System.out.println("Enter the first int:");
  12. int a = input.nextInt();
  13. System.out.println("Enter the first int:");
  14. int b = input.nextInt();
  15. System.out.println("Simon says 'The min is: " + myMin(a,b) + "'");
  16. System.out.println("Simon says 'The max is: " + myMax(a,b) + "'");
  17. }
  18. }
Add Comment
Please, Sign In to add comment