└── first and second largest number /first and second largest number: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | public class Main 3 | { 4 | public static void main(String[] args) { 5 | Scanner Sc=new Scanner(System.in); 6 | System.out.println("Enter the number: "); 7 | int n=Sc.nextInt(); 8 | System.out.println("Enter the value of Array: "); 9 | int a[]=new int[n]; 10 | int l1=0; 11 | int l2=0; 12 | for(int i=0;il1){ 17 | l2=l1; 18 | l1=a[i]; 19 | } 20 | else if(a[i]>l2&&a[i]