1. Program to find the area and perimeter of a rectangle.
#include <iostream>
#include <conio.h>
using namespace std;
int main() {
int length, width, area, perimeter;
cout << "Enter the length of the rectangle: ";
cin >> length;
cout << "Enter the width of the rectangle: ";
cin >> width;
// Calculate the area
area = length * width;
// Calculate the perimeter
perimeter = 2 * (length + width);
// Display the results
cout << "Area of the rectangle: " << area << endl;
cout << "Perimeter of the rectangle: " << perimeter << endl;
getch();
return 0;
}