Question: Write a program to declare a single dimension integer array and initialize it to the following values: 12,34,56,78. Now add code to the program to
Write a program to declare a single dimension integer array and initialize it to the following values: 12,34,56,78. Now add code to the program to sum array elements and calculate the average value. Print the sum and the average. Use a loop (for or while) and an index variable to the sum the values. The algorithm you design should work for an array of any size, not just this array with 4 values.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
