an array elements are always stored in ........... memory location
Answers
Answer: Edit
C provides arrays to store a series of elements of one data type. Let us start with an analogy. Suppose that you have a cupboard in your house. You would like to keep books on each shelf of the cupboard. It would be nice to keep books related to one subject on one rack, books of another subject on another rack. A rack is an array. A rack is used to store books of the same subject. Similarly, an array can store data of the same type. When you declare an array, you must specify the type of data this array will hold. Every element of the array must be of that data type.
The syntax for declaring an array is:
data_type array_name[size];
For example:
int x[5];
Is an array of integers, with size 5, called x. Similarly,
float y[6];
is an array of floating point numbers, with size 6, called y.
To access the elements of an array, you must use array notation. The first element of an array is at position 0, the second at position 1, etc. The last element of an array is at position size - 1.
x[1] = 10;
As you can see, once you have selected an element using array notation, you can manipulate that element as you would any variable. Here is a more complex example:
int z[2];
z[0] = 10;
z[1] = 50;
z[0] = z[0] + z[1]; /* z[0] now contains the integer 60 */
Array Initialization I Edit
When an array is declared, it is initially 'empty'; it does not contain any values. We can initialise an array as follows:
int x[5] = {5, 7, 2, 3, 8};
Explanation: