Respuesta :
Answer:
Replace
/* Your solution goes here */
with the following;
for (i = 0; i < SCORES_SIZE - 1; i++) {
newScores[i] = oldScores[i + 1];
}
newScores[SCORES_SIZE - 1] = oldScores[0];
The full program becomes
#include
int main(void) {
const int SCORES_SIZE = 4;
int lowerScores[SCORES_SIZE];
int i;
for (i = 0; i < SCORES_SIZE; ++i) {
scanf("%d", &(lowerScores[i]));
}
for (i = 0; i < SCORES_SIZE - 1; i++) {
newScores[i] = oldScores[i + 1];
}
newScores[SCORES_SIZE - 1] = oldScores[0];
for (i = 0; i < SCORES_SIZE; ++i) {
printf("%d ", lowerScores[i]);
}
printf("\n");return 0;
}
What the included code segment does it that;
for (i = 0; i < SCORES_SIZE - 1; i++) {
newScores[i] = oldScores[i + 1];
}
The above assigns the values of array oldScores to newScores starting with the second element of array oldScores till the last.
newScores[SCORES_SIZE - 1] = oldScores[0];
The above line then assigns the first element of oldScores to the first element of newScores array