Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class MinMax{
- public static int myMin(int x, int y){
- return x < y ? x : y;
- }
- public static int myMax(int x, int y){
- return x > y ? x : y;
- }
- public static void main(String[] args){
- Scanner input = new Scanner(System.in);
- System.out.println("Enter the first int:");
- int a = input.nextInt();
- System.out.println("Enter the first int:");
- int b = input.nextInt();
- System.out.println("Simon says 'The min is: " + myMin(a,b) + "'");
- System.out.println("Simon says 'The max is: " + myMax(a,b) + "'");
- }
- }
Add Comment
Please, Sign In to add comment