Click Here To Follow our Telegram Channel for more such news and amazing free stuffs.
Telegram Channel - https://t.me/codexelltech
import java.util.Scanner;
Telegram Channel - https://t.me/codexelltech
import java.util.Scanner;
class Largest
{
public static void main(String args[])
{
int x, y, z;
System.out.println("Enter three numbers:");
Scanner in = new Scanner(System.in);
x = in.nextInt();
y = in.nextInt();
z = in.nextInt();
if (x>y && x>z)
System.out.println("First number is the largest.");
else if (y>x && y>z)
System.out.println("Second number is the largest.");
else if (z>x && z>y)
System.out.println("Third number is the largest.");
else
System.out.println("The numbers are not distinct.");
}
}
{
public static void main(String args[])
{
int x, y, z;
System.out.println("Enter three numbers:");
Scanner in = new Scanner(System.in);
x = in.nextInt();
y = in.nextInt();
z = in.nextInt();
if (x>y && x>z)
System.out.println("First number is the largest.");
else if (y>x && y>z)
System.out.println("Second number is the largest.");
else if (z>x && z>y)
System.out.println("Third number is the largest.");
else
System.out.println("The numbers are not distinct.");
}
}
Output:
Enter three numbers:
28
67
78
Third number is largest.
Click Here To Follow our Telegram Channel for more such news and amazing free stuffs.
Telegram Channel - https://t.me/codexelltech
Click here to visit www.codexell.tech for more such references.