MainMenu

Home Java Overview Maven Tutorials

Sunday, 15 January 2017

Java program to find greatest Number

Java Simple program to find greatest Number Among Three Numbers

public class Test
{
public static void main(String[] args)
{
int x = 10;
int y = 12;
int z = 15;
if (x > y && x >z)
{
System.out.println("The greated no. is : " +x);
}
else if (y>x && y>z)
{
System.out.println("The greated no. is : " +y);
}
else{
System.out.println("The greated no. is : " +z);
}
}
}
Output : 15.




No comments:

Post a Comment