3.0+Manipulating+Arrays

This is our current array allocation for the Count

Count[0] = 1;  First element in Array Count[1] = 2;  Second element in Array Count[2] = 3;  Third element in Array Count[3] = 4;  Fourth element in Array Count[4] = 5;  Fifth element in Array

//**How to access elements in an array?**

To access is to retrieve its value, we can do by Make use of the name of the array and its index to access its value
 * Count [index] **

eg. To assign the fifth element in the array Count to variable X. Current value in Count[4] is 5 X = Count[4]; //X will take on the value 5 We make use of the '=' operator to perform assigning.

To make changes, replace the current value in the respective elements in the array.
 * How to make changes to elements of an array?**

Current value in Count[4] is5  Count[4] = 7; Again we make use of the '=' operator to replace its value with 7.
 * eg. To replace the fifth element in array with value 7**

Question: 1) What will happened if I try to access an element that is out of bound a) Greater than the upper bound? Eg. For Count array, Count[7]? b) Lesser than the lower bound? Eg Count[-3] c) What is the lower bound for all arrays? d) Is there a fix upper bound for all arrays? Why?