Write a program in C++ to find the Area and Perimeter of a Rectangle.
Write a program in C++ to find the Area and Perimeter of a Rectangle.
#include<iostream>
using namespace std;
int main()
{
int w,l,area,peri;
cout<<"length of rectangle:";
cin>>l;
cout<<"width of rectangle:";
cin>>w;
area=(l*w);
peri=2*(l+w);
cout<<"the area of trangle:"<<area<<endl;
cout<<"the perimeter of trangle:"<<peri<<endl;
}
#include<iostream>
using namespace std;
int main()
{
int w,l,area,peri;
cout<<"length of rectangle:";
cin>>l;
cout<<"width of rectangle:";
cin>>w;
area=(l*w);
peri=2*(l+w);
cout<<"the area of trangle:"<<area<<endl;
cout<<"the perimeter of trangle:"<<peri<<endl;
}

No comments