diff --git a/cpp/inset_sort.cpp b/cpp/inset_sort.cpp new file mode 100644 index 000000000..67d9f01b8 --- /dev/null +++ b/cpp/inset_sort.cpp @@ -0,0 +1,32 @@ +#include +#include +void main() +{ + clrscr(); + int size, arr[50], i, j, temp; + cout<<"Enter Array Size : "; + cin>>size; + cout<<"Enter Array Elements : "; + for(i=0; i>arr[i]; + } + cout<<"Sorting array using selection sort ... \n"; + for(i=1; i=0)) + { + arr[j+1]=arr[j]; + j=j-1; + } + arr[j+1]=temp; + } + cout<<"Array after sorting : \n"; + for(i=0; i