Skip to content

Commit 027d546

Browse files
committed
a function that sorts an array of integers in ascending order using the Bubble sort algorithm
1 parent 47efa73 commit 027d546

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

0-main.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include "sort.h"
4+
5+
/**
6+
* main - Entry point
7+
*
8+
* Return: Always 0
9+
*/
10+
int main(void)
11+
{
12+
int array[] = {19, 48, 99, 71, 13, 52, 96, 73, 86, 7};
13+
size_t n = sizeof(array) / sizeof(array[0]);
14+
15+
print_array(array, n);
16+
printf("\n");
17+
bubble_sort(array, n);
18+
printf("\n");
19+
print_array(array, n);
20+
return (0);
21+
} /* End function */

0 commit comments

Comments
 (0)