/* Here is a description of an algorithm called the bubble sort that, given an array of n numbers, sorts them in ascending order. 1. Starting at the first position, traverse through all the elemnts of the array. - If the element at the current position is greater than the element at the immediate next position, then swap these two elements. 2. Do this for all positions up to n-1. 3. If there was at least one swap in the previous iteration, then go back to the first step. Otherwise, the array is sorted. Write a program that implements bubble sort. The function should print the array contents before each iteration. In the main function, declare an array of size 8; ask the user to enter 8 integers into the array. Apply the sort function on this array. Author:rahule@cse.iitk.ac.in */ #include // Function Bubble Sort// void bubble_sort(int a[],int n) { int i,j,temp,count; for(i=0;ia[j+1])//If an element is greater than next element then swap them { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; count=1;//Count keeps tracks whether there was any swaps in this iteration } } printf("\n Array after %d iteration is ",(i+1)); for(j=0;j