----- Original Message -----
From: "Varadha Rajan" <[email protected]>
To: <[email protected]>
Sent: Tuesday, July 28, 2009 12:36 PM
Subject: Re: [c-prog] geometric mean
This is from yours,
V.VARADHA RAJAN
double Sma(double *nums, int n)
{
double total = 0;
int i;
for (i = 0; i < n; i++)
total += nums[i];
return total / n;
}To find geometric mean also try the followingdouble Sma(double *nums, int
n)
{
double total = 0;
int i;
for (i = 0; i < n; i++)
total *= nums[i];
return pow(total,double(1/n));
}Please send comment on this mail..Thank you..
I see. Yes the 1/n would be the same as a radical number.
BIll
[Non-text portions of this message have been removed]