But there isn't an index at 5. The assignment states:


a[0] = 'A' a[1] = 'B' a[2] = 'C'
a[3] = 'D' a[4] = 'E'

and the bounds are 1 and 4. Then after the function is run the array elements should

be:

a[0] = 'A' a[1] = 'D' a[2] = 'C'
a[3] = 'B' a[4] = 'e'