Rohan is writing a C++ program to calculate the area of a room whose all four sides are equal. Can you help him to achieve this task?
Answers
Answered by
0
Answer:
// CPP program to find area
// and perimeter of rectangle
#include<bits/stdc++.h>
using namespace std;
// Utility function
int areaRectangle(int a, int b)
{
int area = a * b;
return area;
}
int perimeterRectangle(int a, int b)
{
int perimeter = 2*(a + b);
return perimeter;
}
// Driver program
int main()
{
int a = 5;
int b = 6;
cout << "Area = " << areaRectangle(a, b) << endl;
cout << "Perimeter = " << perimeterRectangle(a, b);
return 0;
}
Similar questions