Sorting algorithms/Bubble sort: Difference between revisions

(→‎{{header|C}}: main(void))
(→‎{{header|C}}: constant)
Line 226:
 
=={{header|C}}==
<lang c>void bubble_sort(int *a, const int n) {
int i, j, t=1;
for (i = n - 1; i && t; i--) {
Line 240:
int main(void) {
int a[] = {4, 65, 2, -31, 0, 99, 2, 83, 782, 1};
int n =bubble_sort(a, sizeof(a) / sizeof(a[0]));
bubble_sort(a, n);
 
return 0;
Anonymous user