Everything at the toy shop is half price today! In the first loop, change each price in prices to half of what it was (they are all even, so they halve exactly); the second loop is already there and shows the new prices, one per line.
5 12 4 15
#include <stdio.h>
int main(void) {
int prices[4] = {10, 24, 8, 30};
for (int i = 0; i < 4; i++) {
// your code here: set prices[i] to half of itself
}
for (int i = 0; i < 4; i++) {
printf("%d\n", prices[i]);
}
return 0;
}
Run tries the examples. When they look right, Submit.