i am trying to make a program which calculates the geometrical average.But i get this error mesage: lvalue required as left operand of assignment
#include
It is rather a mathematical problem than a programming problem. If you know that
average*average = number1*number1+number2*number2
you must evaluate average first. Solution is
average = sqrt(number1*number1+number2*number2)
EDIT1: but geometric mean should be computed as
average = sqrt(number1 * number2)
according to http://en.wikipedia.org/wiki/Geometric_mean
Use this formula to calculate Geometric average:
Geometric average = square root of (number1 * number2)
#include<stdio.h>
#include<math.h>
int main()
{
float number1,number2,average;
printf("enter the numbers which you want to calculate geometrical average of them > ");
scanf("%f %f",&number1,&number2);
average=sqrt(number1*number2);
printf("Geometrical average is:%f",average);
return 0;
}