Bubble sort is a beginners sorting program, it is most learned, but not most used widely due to its time complexity.
Bubble sort time complexity is
Code for Bubble Sort in C
printf(“\n Enter the max no.of Elements to Sort: \n”);
printf(“\n Enter the Elements : \n”);
for(i=0; i<n; i++)
Output for bubble sort program:
Enter the max no.of Elements to Sort: 5 Enter the Elements : 45 21 89 78 99 21 45 78 89 99