Write the code to solve the following problem. Create a program that calculates the area of a rectangle. The user enters the length and width values.The program will collect the values, make the calculation and display the result. Include comments on each line documenting the purpose of each statement. In C ++ language Please.
HERE IS THE CODE
#include <iostream>
using namespace std;
int main() {
// initialising variables
int length,breadth;
cout<<"Enter length: ";
cin>>length;
cout<<"\nEnter breadth: ";
cin>>breadth;
// formula
int area=length*breadth;
cout<<"\n"<<area;
return 0;
}
SOME OUTPUTS
Get Answers For Free
Most questions answered within 1 hours.