@@ -0,0 +1,1013 @@
+package java_problems.beginner;%0D%0A%0D%0Aimport java.util.Arrays;%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/*%0D%0A * Three numbers A, B and C are the inputs. Write a program to find second%0D%0A * largest among three numbers.%0D%0A * %0D%0A * Input: %0D%0A * The first line contains an integer T, total number of testcases. Then follow%0D%0A * T lines, each line contains three integers A, B and C.%0D%0A * %0D%0A * Output: %0D%0A * Display the second largest among A, B and C.%0D%0A * %0D%0A * Constraints: %0D%0A * 1 %3C= T %3C= 1000%0D%0A * 1 %3C= A,B,C %3C= 1000000%0D%0A * %0D%0A * Example %0D%0A * Input:%0D%0A * 3%0D%0A * 120 11 400%0D%0A * 10213 312 10%0D%0A * 10 3 450%0D%0A * %0D%0A * Output: %0D%0A * 120%0D%0A * 312%0D%0A * 10%0D%0A */%0D%0Apublic class SecondLargest %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%0D%0A%09%09Scanner sc = new Scanner(System.in);%0D%0A%09%09int numCases = Integer.parseInt(sc.nextLine());%0D%0A%09%09for (int i = 0; i %3C numCases; i++) %7B%0D%0A%09%09%09int%5B%5D arr = new int%5B3%5D;%0D%0A%09%09%09for (int j = 0; j %3C arr.length; j++) %7B%0D%0A%09%09%09%09arr%5Bj%5D = sc.nextInt();%0D%0A%09%09%09%7D%0D%0A%09%09%09Arrays.sort(arr);%0D%0A%09%09%09System.out.println(arr%5B1%5D);%0D%0A%09%09%7D%0D%0A%09%09sc.close();%0D%0A%09%7D%0D%0A%7D

Add SecondLargest