Home » Technical Questions » Programming

Write a c program for insertion sort.

Correct Answer: #include int main(){ int i,j,s,temp,a[20]; printf("Enter total elements: "); scanf("%d",&s); printf("Enter %d elements: ",s); for(i=0;i=0)){ a[j+1]=a[j]; j=j-1; } a[j+1]=temp; } printf("After sorting: "); for(i=0;i

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion