1#include <cstdlib>
2
3//declare compare
4int compare(const void* a, const void* b)
5{
6 const int* x = (int*) a;
7 const int* y = (int*) b;
8
9 if (*x > *y)
10 return 1;
11 else if (*x < *y)
12 return -1;
13
14 return 0;
15}
16
17//fuction used
18qsort(arr,num,sizeof(int),compare);
19