C > Beginners Lab Assignments
Bubble Sorting Algorithm
Bubble Sorting Algorithm #include
#include
void bubblesort(int *, const int, char); void swap(int *, int *); int main() { const int i = 10; int a[11]; char b; printf("Enter a number: "); int c; for (c=0;c<10;c++) { printf("%d: ",c+1); scanf("%d",&a[c]); } printf("Data Items in Original Order: "); for (c=0;c
array[j+1]) { printf("%d : ",array[j]); printf("%d ",array[j+1]); swap(&array[j],&array[j+1]); } } if (order=='d') { if (array[j]
C Codes
Beginners
C on Unix
Code Snippets
Data Structures
File Operations
Games Graphics
Gnu-Linux
Hardware
Mathematics
Miscellaneous
Small Programs
Sorting