Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javalesson6;
- import java.util.Scanner;
- public class Javalesson6 {
- public static void main(String[] args)
- {
- {
- int x, y, z;
- System.out.println("Enter three integers");
- Scanner in = new Scanner(System.in);
- x = in.nextInt();
- y = in.nextInt();
- z = in.nextInt();
- if (x > y && x > z)
- System.out.println(x+" is largest.");
- else if (y > x && y > z)
- System.out.println(y+" is largest.");
- else if (z > x && z > y)
- System.out.println(z+" is largest.");
- else
- System.out.println("The numbers are not distinct.");
- }
- }}
Add Comment
Please, Sign In to add comment