Java program to find greater number among three number
import java.util.Scanner;
public class GreaterNumberAmongThreeNumber
{
public static void main(String args[ ])
{
Scanner s=new Scanner(System.in)
int a, b, c;
a=s.nextInt();
b=s.nextInt();
c=s.nextInt();
if(a>b)
{
if(a>c)
System.out.println("a is maximum");
else
System.out.println("c is maximum");
}
else
{
if(b>c)
System.out.println("b is maximum"):
else
System.out.println("c is maximum");
}
}
}
Output
Enter the value of a, b, c
10
30
20
b is maximum
Comments