Monday, December 1, 2014

The Area & Perimeter of a Rectangle in c++



To find the Area and Perimeter of a Rectangle


#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;

}

No comments:

Post a Comment