Write a program using if else and ternary opertors to find the second smallest number
Answers
Answered by
4
Answer:
import java.util.*;
class Program
{
public static void main ()
{
Scanner sc= new Scanner (System.in);
System.out.println("Enter 3 numbers");
int v= sc. nextInt();
int a= sc.nextInt();
int i= sc.nextInt();
int e=sc.nextInt();
int k= sc.nextInt();
int e= (int) Math.min(v,a);
int k=(int) Math.max(e,i);
System.out.println("Second smallest number="+k);
}
}
Answered by
1
Answer:
import java.util.*;
class Disarium
{
public static void main()
{import java.util.*;
class Disarium
{
public static void main()
{import java.util.*;
class Disarium
{
public static void main()
{import java.util.*;
class Disarium
{
public static void main()
{import java.util.*;
class Disarium
{
public static void main()
{import java.util.*;
class Disarium
{
public static void main()
{
Similar questions