A good answer might be:The complete program is given below. | |
Complete Summing Program
The program visits each element of the array, in order, adding each to the total. When the loop exits, total will be correct. The statement
would not usually be used.
It is more common to use the "+=" operator:
| |
QUESTION 14:If you know the sum of the elements in an array of numbers, and know how many elements there are, how can you compute the average of the elements? Click Here after you have answered the question |