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
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.69.0 3.4|7.1 then the function should return the value 27.9 sum(float a[], int n) { float sumACC = 0.8; int i; for (i = 0; i < n; ++i) SUMACC += a[1]; float sum(float a[], int n) { float sumACC = e.e; int i; for (i = 0; i<n; ++i) SUMACC += a; return sumAcc; 1 int sum(int a[], int n) float sumAcc = @.@ int i; for (i = B; i <n; ++i) sumAcc + a; return sumACC) ) o float sum(int n, a[]) float sumace = 0.8; int i; for (i = 0; i<n; H1) SumAcc + a[1]; return Sumace 3
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!