Posted By

Insertion Sort Program in C

Education 25

#include<stdio.h>

int main()


{       

    int i, j, temp;    

    int size=10;     

    int number[10] = {9, 10, 13, 14, 61, 17, 91, 11, 21, 3};         


    for(i=1;i<size;i++){

        temp=number[i];

        j=i-1;

        while((temp<number[j])&&(j>=0)){

            number[j+1]=number[j];

            j=j-1;

        }

        number[j+1]=temp;

    }      


printf("Sorted elements by Using Insertion Sort: ");     


    for(i=0;i<size;i++)

        printf(" %d",number[i]);       

    return 0;  

Insertion Sort Program in C

Login to comment login

Latest Jobs
  • Bangladesh Inland Water Transport Authority Junior River Surveyor Job Circular
    Bangladesh Inland Water Transport Authority
    Education: Bachelor Degree
    Experience: 0 Years
    Deadline: 10 Feb 2019
  • Bangladesh Inland Water Transport Authority River Surveyor Job Circular
    Bangladesh Inland Water Transport Authority
    Education: Bachelor Degree
    Experience: 0 Years
    Deadline: 10 Feb 2019
  • Bangladesh Navy Sub Assistant Engineer Job Circular
    Bangladesh Navy
    Education: B.Sc in Mechanical/ Computer Science Engineering
    Experience: 0 Years
    Deadline: 9 Feb 2019
  • LankaBangla Finance Limited Trainee Credit Analyst Job Circular
    LankaBangla Finance Limited
    Education: Graduate/Post Graduate
    Experience: 0 Years
    Deadline: 2 Feb 2019
  • Jahangirnagar University Store Keeper Job Circular
    Jahangirnagar University
    Education: Bachelor Degree
    Experience: 0 Years
    Deadline: 7 Feb 2019