Page 1 :
Monday, August 02, 2021, 8:16 PM, , COMBINED ISC 135 Page 1
Page 7 :
import java.util.*;, class insert, {, int a[],size;, insert(int s), {, size=s;, a=new int[size];//creating array, }, void get(), {, Scanner sc=new Scanner(System.in);, System.out.println("Enter array elements");, for(int i=0;i<size;i++), a[i]=sc.nextInt();, }, void sort(), {, int i,j,t;, for(i=1;i<size;i++), {, t=a[i];, for(j=i-1;j>=0;j--), {, if(t<a[j]), a[j+1]=a[j];, else, break;, }, a[j+1]=t;, }, }, , void display(), {, int i;, COMBINED ISC 135 Page 7
Page 8 :
int i;, for(i=0;i<size;i++), System.out.print(a[i]+" ");, , }, public static void main(), {, Scanner sc=new Scanner(System.in);, System.out.println("Enter size of array");, int sz=sc.nextInt();, array obj=new array(sz);, obj.get();, System.out.println("Original array is");, obj.display();, obj.sort();, System.out.println("\nSorted array is");, obj.display();, }, }, , COMBINED ISC 135 Page 8