Question #20028

36-8. Where is the error in this code sequence?
double [ ] a = { 3.3, 26.0, 48.4 };
a[4] = 2.5;

Expert's answer

The size of array a[] = 3 and we're trying to assign 2.5 to the 4th element which can't happen.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS