How to findout area of rectangle in C++

The length and breadth of a rectangle and radius of circle are input through the keyboard.Write a program to calculate the area and perimeter of the rectangle, and the area & circumference of the circle. Covered Area Problem is a classic algorithm problem used for academic teaching purposes. The basic idea is to give several pairs of Cartesian coordinates as the input. Each pair of coordinate represents the upper-left corner and lower-right corner of a rectangle. The goal of the system is to find out the total area covered by all those rectangles. Please note that we can not just add all the covered area of each rectangles since the rectangles can be overlapped each other in any order.
void main()
int l,b,r,area1,perimeter;
float area2,circum;
printf(“nEnter Length & Breadth of Rectangle”);
printf(“nArea of Rectangle=%d”,area1);
printf(“nPerimeter of Rectangle=%d”,perimeter);
printf(“nnEnter Radius of circle”);
printf(“nCircumference of circle=%f”,circum);
printf(“nnnnnnPress any key to exit…….”);

Leave a Reply