Help with array question

Suppose that we are given the following code:
int[] myArray = {1, 3, 5, 7, 9, 11, 13, 15};
for (int i = 0; i < myArray.length; i++) {
myArray[i] = 10 - myArray[i];
}
After it is executed what will the array myArray contain?( Please explain in details)
closed account (48T7M4Gy)
Where do you need help?
if you execute the code (with some cout statements obviously)you will get a pretty fair idea what it does and what myArray contain....
I am not sure how it execute and the result
closed account (48T7M4Gy)
try filling in and running the program

int main()
{
}
also add a cout statement inside the loop to see what the array contains after the change
Topic archived. No new replies allowed.