Answer to Question #281019 in C++ for ghinzy

Question #281019

Write a program that calls a udm to calculate the area of a rectangle.

In the main method, ask user to enter two numbers. Call the calArea method to

return the area of the rectangle. calArea accepts two double and returns the area

as a double, formatted in two decimal places.


1
Expert's answer
2021-12-20T09:59:55-0500
#include<bits/stdc++.h>
using namespace std;


void calArea()
{
    double l , b, area;
    
    cout<<"Enter the Length: ";
    cin>>l;
    
    cout<<"Enter the Breadth: ";
    cin>>b;
    
    area = l * b;
    
    cout<<"Area of Rectangle is : "<<area;
}




int main()
{
    calArea();
    
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog