Thursday, June 3, 2021

C++ program check area and perimeter of the rectangle (POP) (114)

#include<iostream>

using namespace std;

int main()

{

int length,width,area,perimeter;

cout<<"please enter the length of rectangle:";

cin>>length;

cout<<"please enter the width of rectangle:";

cin>>width;

area=length*width;

cout<<"the area of the rectangle is:"<<area<<endl;

perimeter=2*length+width;

cout<<"the perimeter of the rectangle is:"<<perimeter<<endl;

} 

No comments:

Post a Comment