Help for coding this programme

for a floating-point array x whose size is n, find the geometric mean..

GM =n x1.x2.x3...xn

Sounds like a school assignment.

The average of the logarithmic values of a data set, converted back to a base 10 number is how to generate a geometric mean.

  1. for each element, generate the log - use the log() function. Keep a running total of the log values.
  2. divide the running total by n
  3. convert the resulting "average" log value base to a base 10 number - exp(avg log value) gives that.

Homework? If so, please repost in the appropriate forum.