write a program with appropriate output to enter 3 no. and display that no. which is greatest no. among them
Answers
Answered by
1
Answer:
import java.util.*
class great
{
void main();
{
Scanner sc = new Scanner (System.in);
System.out.println("Enter Three Numbers");
int n1=sc.nextInt();
int n2=sc.nextInt();
int n3=sc.nextInt();
int n4=0;
if(n1>n2&&n1>n3)
n4=n1;
elseif(n2>n1&&n2>n3)
n4=n2;
else
n4=n3;
System.out.println("The Greatest Number Among The Three Numbers Are\t"+n4);
}
}
Output
Enter Three Numbers
25
42
93
The Greates Number Among The Three Numbers Are 93
Similar questions