Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
#include
#include
int compare(const void *a, const void *b) { return (*(int*)a - *(int*)b); } int main() { int numbers[] = { 5, 2, 9, 1, 7 }; int size = sizeof(numbers) / sizeof(numbers[0]); qsort(numbers, size, sizeof(int), compare); for (int i = 0; i < size; i++) { printf("%d ", numbers[i]); } return 0; }
1 2 5 7 9