// write a code to find nth largest element in an array using function import java.util.Scanner; class NthLargestElementInArray{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.println("Enter the size of the array"); int n = sc.nextInt(); int[] arr = new int[n]; System.out.println("Enter the elements of the array"); for(int i=0;i