Question
Write a function that receives, as arguments, a pointer to a double array, as well as the number of elements in the array (int). The function must use pointer operations and calculate the standard deviation of the elements in the array. The function returns the standard deviation to the calling statement.
Use the function in main() to display its operation.
Write a function that receives, as arguments, a pointer to a double array, as well as the number ot the elements in the array The function retums the standard deviation to the calling statement Use the function in main) to display its operation. elements in the aray (nt). The function must use pointer ope Example: array (11.2, 2.4, 3.13, 16.4, 5.8, 9.22, 4.9, 10.5, 6.5, 2.99 stdDevfarray) 4.249367 2 i-1 i-1 Wenk: is telkens die ide element in die skikking. Hint: x denotes the ith element in the array. e here to search
Explanation / Answer
#include #include using namespace std; double standard_deviation(double *arr, int size) { double mean = 0; for(int i = 0; i