Select the function that takes as its arguments the following: 1. an array of floating point values; 2. an integer that tells how many floating point values are in the array. The function should return as its value the sum of the floating point values in the array Example: If the array that is passed to the function looks like this: 0 1 2 3 4. 5.8 2.6 9.0 3.4 7.1 then the function should return the value 27.9 O sum(float all, int n) 0.0; float sumACC int i; for (i = 0; i<n; ++i) SUMACC += a;
O float sum(float all, int n) { float sumACC = 0.0; int i; for (i = 0; i < n; Hi) SUMACC += a; return sumACC; } o float sum(int n, a[]) { float sumACC = 0.0 int i; for (i = 0; i<n; ++i) sumACC += a; return sumACC; } o int sum(int a[], int n) { float sumACC = 0.0; int i; for (i = 0; i<n; ++i) SUMACC + a; return sumACC; 3
Select the function that takes as its arguments the following: 1. an array of floating point values; 2. an integer that
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Select the function that takes as its arguments the following: 1. an array of floating point values; 2. an integer that
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!