--- In [email protected], Varadha Rajan <vrajmca1...@...> wrote:
>
> 
> 
> 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..

 What exactly is the double in the pow() function for? If it's a cast doesn't 
it have to be in parenthesis?

B


Reply via email to