what will be it's solution
Answers
Here is your code.
import java.util.*;
class Second_Smallest
{
public static void main(String s[])
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter first number: ");
int a=sc.nextInt();
System.out.print("Enter second number: ");
int b=sc.nextInt((;
System.out.print("Enter third number: ");
int c=sc.nextInt();
int s=0;
if(a>b)
{
if(b<c)
s=b;
else
s=c;
}
if(b>c)
{
if(c<a)
s=c;
else
s=a;
}
if(c<a)
{
if(a<b)
s=a;
else
s=b;
}
System.out.println("Second Smallest Number is: "+s);
}
}