diff --git a/Sorting/Insertion Sort/insertionSort.c b/Sorting/Insertion Sort/insertionSort.c new file mode 100644 index 0000000..fb9bb29 --- /dev/null +++ b/Sorting/Insertion Sort/insertionSort.c @@ -0,0 +1,34 @@ + +/*INSERTION SORT MECHANISM */ + +#include +int main(){ + + int i, j, c, t, number[25]; + + printf("Enter the total number of elements:"); + scanf("%d",&c); + + printf("Enter %d elements: ", c); + // Loop to fill the array with the input numbers + + for(i=0;i=0)){ + number[j+1]=number[j]; + j=j-1; + } + number[j+1]=t; + } + + printf("Order of Sorted elements: "); + for(i=0;i