write a Java Program to input any three numbers and print the greatest number among them.
please answer quickly..
Answers
Answered by
2
Answer:
Explanation:
public class Biggest_Number
{
public static void main(String[] args)
{
int x, y, z;
Scanner s = new Scanner(System.in);
System.out.print("Enter the first number:");
x = s.nextInt();
System.out.print("Enter the second number:");
y = s.nextInt();
System.out.print("Enter the third number:");
z = s.nextInt();
if(x > y && x > z)
{
System.out.println("Largest number is:"+x);
}
else if(y > z)
{
System.out.println("Largest number is:"+y);
}
else
{
System.out.println("Largest number is:"+z);
}
}
}
Similar questions
Geography,
3 months ago
English,
3 months ago
English,
3 months ago
CBSE BOARD X,
7 months ago
Computer Science,
7 months ago
Physics,
11 months ago
Math,
11 months ago
Geography,
11 months ago