Compute and display the output of the Area (A) of a rectangle, based on
inputted value for length (L) and the width (W).
Formula: A = L * W
Flowchart to C++ code
#include<iostream>
using namespace std;
int main()
{
float L,W;
cout<<"Enter L: ";
cin>>L;
cout<<"Enter W: ";
cin>>W;
float A = L * W;
cout<<"The area (A) of a rectangle = "<<A<<"\n\n";
system("pause");
return 0;
}
Comments
Leave a comment