C语言编程:使用长和宽计算矩形面积

编写一个C 程序,使用长和宽计算矩形的面积,并附带示例。

使用长和宽计算矩形面积的程序

程序允许用户输入矩形的长和宽。使用这些值,该编程语言将计算矩形的面积。

提示:如果我们知道矩形的长和宽,那么我们可以使用公式计算矩形的面积:面积 = 长 × 宽。

#include<stdio.h>
int main()
{
float width, length, Area;

printf ("\n Please Enter the Width of a Rectangle : ");
scanf ("%f",&width);

printf ("\n Please Enter the Length of a Rectangle : ");
scanf ("%f",&length);

Area = length * width;

printf("\n The Area of a Rectangle = %.2f", Area);

return 0;
}
C Program to find Area of a Rectangle using length and width