Question: For the lab assignment, you need to create an array of integers that is initialized to the even numbers from 0 through 98. Print out
For the lab assignment, you need to create an array of integers that is initialized to the even numbers from 0 through 98. Print out this array to show that it contains all the correct numbers. Next, calculate the total of the elements indexed by an even number (that is, every other one starting with element zero) and print that along with the corresponding average. Finally, calculate the total of the elements indexed by an odd number (that is, every other one starting with element one) and print that total along with the corresponding average for this set of elements. Important notes: Global variables are not allowed. You must use looping to calculate your totals and averages. For example, you may not just hard-code an expression that involves the 0th element of the array, the 2nd element of the array, the 4th element of the array, etc.
C programming please
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
