Java Program for Sorting
import java.io.*; class sort { public static void main(String ar[])throws IOException { DataInputStream n=new DataInputStream(System.in); int temp,i,no,a[]=new int[20]; System.out.println("enter the no. of elements to be sorted not greater than 20"); String lim=n.readLine(); no=Integer.parseInt(lim); System.out.println("enter the ("+no+") numbers: "); for(i=0;ia[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } } System.out.println("the list after sorting is: "); for(i=0;i