PDA

View Full Version : Sorting code in c++



Vuhelper
06-09-2011, 10:03 PM
1.
#include <stdio.h>
2.
#include <stdlib.h>
3.

4.
int main()
5.
{
6.
int numbers[10] = {12,33,51,1,-1,97,7,23,0,-99};
7.

8.
sort(numbers,10);
9.
display(numbers,10);
10.
return 0;
11.
}
12.

13.
void sort(int *numbers, int size)
14.
{
15.
/*
16.
Hop you could help me provide codes to sort the numbers. after calling this function, the numbers array in main should be sorted.
17.

18.
hint: use the size for looping
19.
*/
20.
}
21.

22.
void display(int *numbers, int size)
23.
{
24.
/*
25.
this will print the array of integers that has been called.
26.
*/
27.
}