C++ Program to find Area and Perimeter of rectangle

#include<iostream.h>
#include<conio.h>
void main()
{
 clrscr();
 int x,y,z1,z2;
 cout<<"Enter height:- ";
 cin>>x;
 cout<<"Enter width:- ";
 cin>>y;
 z1=x*y;
 z2=2*(x+y);
 cout<<"Area of rectangle is: "<<z1<<endl;
 cout<<"Perimeter of rectangle is: "<<z2;
 getch();
}

OUTPUT:-

Leave a Reply

Your email address will not be published. Required fields are marked *