Professional Documents
Culture Documents
15
15
a) ternary operator
b) nested if.*/
/*import java.util.*;
class largernum
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
int max;
max = (a > b) ? (a > c ? a : c) : (b > c ? b : c);
System.out.println("Maximum number "+ max);
}
}*/
import java.util.*;
class largernum
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
if( a>=b && a >= c)
System.out.println(a + " is the largest number.");
else
System.out.println(c + " is the largest number.");
}
}