Insertion Sort Implementation

Insertion Sort is another sorting algorithm better than bubble sort or selection sort. Even if the complexity of insertion sort is O(n2) sorting on large data set is quite useful feature. The Insertion Sort algorithm has O(n) when the list is already sorted.
#include<stdio.h>

void print_array(int a[],int len){
	int i;
	for(i=0;i<len;i++)printf("%d ",a[i]);
}
void insertion_sort(int a[],int len)
{
	int i,j,temp;
	/* Insertion Sort runs in O(n^2) */
	for(i=1;i<len;i++){
		temp = a[i];
		for(j=i-1;j>=0;j--)
		{
			if(temp > a[j]) break;
			a[j+1] = a[j];
		}
		a[j+1] = temp ;
		printf("\nArray after %d iteration\n",i+1);
		print_array(a,len);
	}
}
int main(){
	/* The initial unsorted array */
	int a[] = {6,3,5,9,2,7,4,8,1} ;
	int len ;
	len = sizeof(a)/sizeof(int);
	insertion_sort(a,len);
	printf("\nSorted Array\n");
	print_array(a,len);
	return 0;
}