To find the Area
and Perimeter of a Rectangle
#include
#include
#include
int main()
{
int width,height,area,perimeter;
cout<<"enter width of rectangle = ";
cin>>width;
cout<<"enter height of rectangle = ";
cin>>height;
area=height*width;
cout<<"area of rectangle ="<
perimeter=2*(height+width);
cout<<" perimeter of rectangle are = "<
return 0;
}
{
int width,height,area,perimeter;
cout<<"enter width of rectangle = ";
cin>>width;
cout<<"enter height of rectangle = ";
cin>>height;
area=height*width;
cout<<"area of rectangle ="<
perimeter=2*(height+width);
cout<<" perimeter of rectangle are = "<
return 0;
}
No comments:
Post a Comment