Question: Write a C program: Define a named constant, SIZE1 = 5 for the size of the array in part-1. Define another named constant, SIZE2 =
Write a C program:
Define a named constant, SIZE1 = 5 for the size of the array in part-1.
Define another named constant, SIZE2 = 20 for Part-2.
Part-1,
Declare an array to store 5 whole numbers. Name this array data. Use the named constant at declaration.
Fill the array by prompting the user for values in a loop.
Write another loop to display values stored in this array.
Compute the average of the values stored in the array. Display the average with 2 digits after the decimal point.
Increment each array element by 1. (You need to write another loop).
Display the updated array to the screen.
Part-2:
Declare another integer array of size 20 to store random test scores use the named constant at declaration. Name this array scores.
Write a loop to fill the array with random numbers between 0 and 100.
Write a loop to display values stored in the array.
Find the average of the scores stored in the array. Display the average to the screen.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
