Skip to main content
Logo image

Section 22.9 Sort Arrays

Activity 22.4.

Suppose you have declared two arrays:
int numbers[]={5, -1, 8, 4, 0, -10};
int sort[6];
What values should you place in your sort array so the following loop prints out the list of numbers, sorted from smallest to largest?
for (i=0; i<6; i++) {
  printf("%d, ", numbers[sort[i]]);
}
Please paste your text submission into the box below, then select Run to submit it: