MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / yield

Function yield

Examples/NoModules/Chapter 08/Ex8_06A.cpp:18–29  ·  view source on GitHub ↗

Function to compute total yield

Source from the content-addressed store, hash-verified

16
17// Function to compute total yield
18double yield(const double array[][4], size_t size)
19{
20 double sum{};
21 for (size_t i{}; i < size; ++i) // Loop through rows
22 {
23 for (double val : array[i]) // Loop through elements in a row
24 {
25 sum += val;
26 }
27 }
28 return sum;
29}
30

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected