lvalue required as left operand of assignment

前端 未结 2 1249
难免孤独
难免孤独 2021-01-29 16:17

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         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-29 16:49

    Use this formula to calculate Geometric average:

    Geometric average = square root of (number1 * number2)

    #include
    #include
    
    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;
    }
    

提交回复
热议问题