Calculating Area of Rectangle Using C Program

The area of a rectangle is a fundamental mathematical concept frequently used in various fields. In C programming calculating the area of a rectangle is a simple yet essential task that demonstrates the basic principles of mathematical computation and variable manipulation in C.

Formula for the Area Of Rectangle

The formula to calculate area of a rectangle is simple and straight forward-

Area = Length * Width

Here, Length represents the longer side of the rectangle while Width represents the shorter side of the rectangle.

C Program to Calculate Area of Rectangle

Let’s write a C program to calculate the area of a rectangle

Output

C Program to Calculate Area of Rectangle

How the Above C Program Works?

  • The program starts with the declaration of three variables- length, width, and area of type float.
  • Then program asks the user to input the length and width of the rectangle.
  • The area of a rectangle is calculated by multiplying the length and width.
  • At the end, the calculated area is printed.

Happy Coding

See Also

3 thoughts on “Calculating Area of Rectangle Using C Program”

Leave a Comment