60 721
Assignments Done
97,9%
Successfully Done
In April 2018

Answer to Question #3311 in C++ for mukunda

Question #3311
Write a program to calculate the area of square, rectangle & circle.
Expert's answer
#include <iostream>
using namespace std;

double area_square (double width) { return width * width; }
double area_rectangle (double width, double height) { return width * height; }
double area_circle (double radius) { return 3.141593 * radius * radius; }

int main()
{
double width = 10, height = 15, radius = 8;
cout << "Area of square is " << area_square (width) << endl;
cout << "Area of rectangle is " << area_rectangle (width, height) << endl;
cout << "Area of circle is " << area_circle (radius) << endl;

return 0;
}

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions