#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
void BubbleSort(int* array, int size)
{
for (int i = 0; i < size - 1; i++)
{
for (int j = i + 1; j < size; j++)
if (array[i]>array[j])
{
int temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
}
void Print(int* array, int size)
{
for (int i = 0; i <= size; i++)
printf("%d \n", array[i]);
}
int main(){
int array[10] = { 1, 3, 5, 8, 9, 2, 4, 6, 7, 0 };
Print(array, sizeof(array) / sizeof(array[0]));
BubbleSort(array, sizeof(array) / sizeof(array[0]));
Print(array, sizeof(array) / sizeof(array[0]));
system(“pause”);
return 0;
}