Computer Science, asked by 20007shreyadas, 3 days ago

#include void main () __A__ int l, b, area; __B__<< “Enter length and breadth:”; cin >>l; cin >>__C__; area=l*b; cout​

Answers

Answered by Anonymous
4

Program:

#include <iostream>

using namespace std;

int main() {

   int l, b, area;

   cout << "Enter length and breadth:";

   cin >> l >> b;

   area = l * b;

   cout << "The area of a rectangle is: " << area;

   return 0;

}

Explanation:

The area of a rectangle is the product of the length and breadth of a rectangle.

 

We've used the same logic here to calculate the area of a rectangle.

 

We've taken user input to accept values of length and breadth and stored them as variables l and b respectively.

 

Then, we've calculated the area of a rectangle using the formula and displayed the result.

Answered by vk6859402
0

Answer:

hope this answer is helpful to you

Attachments:
Similar questions