# C++ Program to Enter Length and Breadth of a Rectangle and Find its Area

__C++__ program to enter length and breadth of a rectangle and find its area.

In this article, you will learn how to write a c++ program to enter length and breadth of a rectangle and find its area.

You should have the knowledge of the following topics in c++ programming to understand this program.

- C++

function**main()** - C++

object**cin** - C++

object**cout**

### Standard formula to calculate the area of a rectangle

`A = l * w`

### where

**A = area of the rectangle**

**l = length of the rectangle**

**w = width of the rectangle**

### Source Code

```
// C++ Program to Enter Length and Breadth of a Rectangle and Find its Area
#include <bits/stdc++.h>
using namespace std;
int main() {
float l, w, a;
cout << "Enter the length & width of the rectangle::\n";
cin >> l >> w;
// Calculate area of rectangle
a = l * w;
// It will print the final output
cout << "\nArea of rectangle = " << a << " units";
return 0;
}
```

### Output

`Enter the length & width of the rectangle::`

`5`

`7`

`Area of rectangle = 35 units`

### Explanation

In the given program, we have taken the inputs

rectangle's height and **5**

rectangle's width the applied the standard formula **7****p = l * w.**

Then It returned to the area

value of the rectangle.**35 units**

#### Also, visit these links

**C Program to Enter Length and Breadth of a Rectangle and Find its Area**

**Java Program to Enter Length and Breadth of a Rectangle and Find its Area**

**Python Program to Enter Length and Breadth of a Rectangle and Find its Area**