Write a C Program to find the Area of a Rectangle using length and width with example.
Program to find Area of a Rectangle using length and width
This program allows the user to enter the length and width of a rectangle. Using those values, this Programming language will calculate the area of a rectangle.
TIP: If we know the length and width of a rectangle, then we can calculate the area of a rectangle using formula : Area = Length * Width.
#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;
}