The following code shows a C Program for Implementing Insertion Sort.

//C Program for Implementing Insertion Sort

#include <stdio.h>
void InsertionSort(int a1[], int Length)
{
    int i, j, x;
    for(i=1;i<Length;i++)
    {
        x = a1[i];
        j = i - 1;
        while((j>=0) && (a1[j]>x))
        {
            a1[j + 1] = a1[j];
            j--;
        }
        a1[j + 1] = x;
    }
}
int main()
{
    int elements_count, i;
    int myarray[] = { 4, 1, 9, -13, 90, 56, 81, 34, -2, -15, 60, 88 };
    elements_count=sizeof(myarray)/sizeof(int);
    printf("Array before sorting...");
    for(i=0;i<elements_count;i++)
        printf("%d ", myarray[i]);
    InsertionSort(myarray, elements_count);
    printf("\nArray after sorting...");
    for(i=0;i<elements_count;i++)
        printf("%d ", myarray[i]);
    printf("\n");

    return 0;
}

Output

Insertion Sort Program in C Language
Insertion Sort Program in C Language

Further Reading

50+ C Programming Interview Questions and Answers

C Program to Find Factorial of a Number