C Programming

ARRAY THEORY QUESTIONS

1

(a)

Define the term array.

(b)

State and explain briefly the general syntax for declaring an array.

2
20 5 10 8 7 18 10 12

A programmer wishes to use array to store the above tabulated data.

Use the information to answer the following questions:

(a)

Write a code to reserve space on the memory for the array to store the above data.

(b)

Write a code to initialize the array with the above data.

(c)

Write a code to access and display the elements of the array.

(d)

Write a code to find the sum of all elements in the array.

(e)

If she wishes to change the value in column 3 to 15, write a code to do so.

(f)

What index of the array could cause an index out of bounds error?