Selection Sort Implementation

Selection sort is good as compared to bubble sort since it has fewer number of swaps. But the algorithm runs in same O(n2) and has a bad attribute that evenif the input array is sorted order the algorithm requires scanning the entire array.  
#include<stdio.h>
void bubble_sort(int a[],int len)
{
	int i,j,k,temp;
	/* Bubble Sort runs in O(n2) */
	for(i=0;i<len;i++){
		for(j=0;j<len-1-i;j++)
		{
			if(a[j]>a[j+1]) 
			{
				/* swap a[j] with a[j+1] */
				temp = a[j];
				a[j] = a[j+1];
				a[j+1] = temp;
			}
		}
		printf("\nArray after %d iteration\n",i+1);
		print_array(a,len);
	}
}
void print_array(int a[],int len){
	int i;
	for(i=0;i<len;i++)printf("%d ",a[i]);
}
int main(){
	/* The initial unsorted array */
	int a[] = {6,3,5,9,2,7,4,8,1} ;
	int len ;
	len = sizeof(a)/sizeof(int);
	bubble_sort(a,len);
	printf("\nSorted Array\n");
	print_array(a,len);
	return 0;
}