Write a Java program to find largest number among three.
public class LargestAmongThree {
public static void main(String[] args) {
int x = 10, y = 15, z = 12;
System.out.print("Largest number among three is : ");
if(x > y) {
if(x > z) {
System.out.print(x);
}
else {
System.out.print(z);
}
}
else {
if(y > z) {
System.out.print(y);
}
else
{
System.out.print(z);
}
}
}
}
Largest number among three is : 15