See More

// Program to return given K th minimum element from the given array import java.util.Scanner; public class KthMinEleFromArray { 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 a[]=new int[n]; System.out.println(" Enter the elements into the array:"); for(int i=0;ia[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } } return a; } }