Question: This is a C program please read and answer according to the question also show output thank you Q2) Write a program that takes the
This is a C program please read and answer according to the question also show output thank you Q2) Write a program that takes the average and variance of an array. The average and variance are calculated by: m=1 run the following command in your terminal, in the same directory as your sort.c file. This command will create a new file that you are to change and submit: sed '3d;9d;21,30d' sort.c > avg.var.c The sed command is used to remove lines from a fle, while the > stores the output of a command (whatever is printed in the terminal) to a new file. The '3d,9d:21,30d' argument states to remove lines 3, 9, and 21-30 from the sort.c file. avg-var.c is now the code to request a size of an array, allocate memory for the array, and fill the array. You must add functionality by adjusting the code to calculate the average and variance of the array. All lines added to the code must be after line 18. Print the average and variance such that the output appears as below (there are NO double spaces): Enter the array size: Enter 3 integers: 1 2 3 The average is: 2.00 The variance is: 0.67 Note: avg.var.c is the file you will turn in for this question inside the .tar file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
