Given the following program, show the values of the array in the figure:
int main() {
int values[5] = {3}; // <--------------- Array created
for(int i = 1; i < 5; i++) { // <----- Loop iterating...
values[i] = i;
} // <----------------------------------- Loop completed
values[0] = values[1] + values[4]; // <–- Last line before return
return 0;
}
After “Array created”
0=?
1=?
2=?
3=?
4=?
After the first iteration
of for loop
0=?
1=?
2=?
3=?
4=?
After “Loop completed”
0=?
1=?
2=?
3=?
4=?
After “Last line before
return”
0=?
1=?
2=?
3=?
4=?