Welcome to the forum, Andrew!
Let's take a peek at your bubbleSort and swap. Swap() looks good. Bubblesort, I'd change to optimize it (and this is a common format, so it's not "out there on the fringe".
I'd change your program around a bit.
Code:
#include <stdio.h>
void bubbleSort (int numbers [], int n);
void swap(int *p, int *q);
int main(void) {
int i,n;
int numbers[10] = {3,1,9,5,7,6,4,2,8,0};
printf("The unsorted array:\n");
for(i=0;i<10;i++)
printf("%d ",numbers[i]);
n=sizeof(numbers)/sizeof(numbers[0]);
bubbleSort(numbers, n); //the const array length isn't what you want.
//Show you why in bubblesort().
printf("The sorted array:\n");
for(i=0;i<10;i++)
printf("%d ",numbers[i]);
/*
get the lowest and highest, here
subtract low from high to get the range
add up your numbers into sum
and divide by n to get the average
and print it all up: %d for int's,
%f for doubles and floats (numbers with a decimal point)
*/
return 0;
}
void bubbleSort (int numbers [], int n) //we'll use n instead of a const
{
int i, sorted = 0;
while (sorted == 0)
{
// Sorted is usually a 1 or 0 value, so let's simplify it to that.
sorted = 1;
i = 1;
while (i < n) //
{
if (numbers [i - 1] > numbers [i])
{
swap (&numbers[i - 1], &numbers[i]);
sorted = 0;
}
i++;
}
n--; //there it is! Bubblesort "sorts" the last unsorted
//element of the array, every time it loops, so we
//don't need to go that far, any more.
}
}
void swap(int *p, int *q)
{
int temp;
temp = *p;
*p = *q;
*q = temp;
}
Of course, you have to have other requirements, so this is not something you can just turn in.