Skip to main content\(\newcommand{\N}{\mathbb N}
\newcommand{\Z}{\mathbb Z}
\newcommand{\Q}{\mathbb Q}
\newcommand{\R}{\mathbb R}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
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: