In programming languages we store values in variables i.e. we allocate a memory location for this value. The variable name identifies the location of the value in memory.
This method proves to be good until we need to store four to five variables. Think of the situation where we need to store ten to twenty values. Storing in variable will increase the length of the program also it is difficult to remember all the variable names. In such situations arrays come to rescue. An array is data structure where we can store multiple values. Each value is given a unique non-negative index number. This index number starts with 0 and increments by 1 for each subsequent vale in the array.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment