错误:二进制^的无效操​​作数(具有“ float”和“ float”)

时间:2019-06-15 13:31:00

标签: c

请帮助我解决它。

Route::get("/articles/{id}", "Api\ArticlesController@singleArticle");
#include <stdio.h>
#include <stdlib.h>

int main()
{

    float Diameter,Area,Circumference,Radius,X,Y;
    X = 3.14159;
    Y = 2.00000;
    printf("Enter Value for Radius : \n");
    scanf("%f",&Radius);
    Diameter = 2*Radius;
    Circumference = 2*X*Radius;
    Area = X*(Radius^Y);
    printf("This Circle Diameter is :%.2f",Diameter);
    printf("This Circle Circumference is :%.2f",Circumference);
    printf("This Circle Area is :%.2f",Area);
    return 0;
}

1 个答案:

答案 0 :(得分:0)

在C ^中是按位XOR运算符。如果要计算幂值,请使用pow()函数。