C Program for Bubble Sort or sorting using Arrays
Bubble Sorting is used in C programming to sort the numbers in increasing order . We just need to enter the required no. and this program will do rest of the work .
Following is the source code for Bubble Sorting program . You just need to copy it in your notepad and save it with the extension *.c or *.cpp . Then open the saved file with your compiler and run it .
int n, i, j, temp , a;
printf("Enter the total integers you want to enter (make it less than 100):\n");
printf("Enter the %d integer array elements:\n",n);
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
printf("The sorted numbers are:");
You may also want to read : C program for insertion sorting in arrays
This program has been written by me for maximum of 100 integers to sort out . If you feel like you want to increase the numbers for sorting , you may change the value of a to a[xyz] where xyz is any integer value .
Further more , you can change the program according to your needs . :) Enjoy Programming .
P.S - The screenshot is the proof of a working program .