# C program to enter the length and breadth of a rectangle and find its area

ADVERTISEMENTS

C program to enter the length and breadth of a rectangle and find its area. There are you will learn how to find the area of a rectangle in C language.

**Formula:**

*P = l * w*

**where:**

`P`

= perimeter

`l`

= length of the rectangle

`w`

= width of the rectangle

Let us understand this through the C program:

```
// C program to find the area of a rectangle
#include <stdio.h>
int main() {
float l, w, a;
printf("Enter the length & width of the rectangle::\n");
scanf("%f", &l);
scanf("%f", &w);
/* Calculate area of rectangle */
a = l * w;
/* Print output */
printf("\nArea of rectangle = %f units ", a);
return 0;
}
```

**Output:**

Enter the length & width of the rectangle::

5

7

Area of rectangle = 35.000000 units