小编Alt*_*ton的帖子

为什么输出0.000000?

有人可以解释为什么这两个变量"area"和"peri"输出0.000000?

int main()
{

    double length, width, peri = (length*2) + (width*2), area = length*width;

    printf("Enter the length of the rectangle in centimeters: ");
    scanf("%lf", &length);
    printf("\nEnter the width of the rectangle in centimeters: ");
    scanf("%lf", &width);

    printf("The perimeter of the rectangle is %lf cm.\nThe area of the rectangle is %lf cm.", circ, area);


    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c

-1
推荐指数
1
解决办法
106
查看次数

标签 统计

c ×1