1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#include<iostream>
using namespace std;
double Area(double height, double width);
double Perimeter(double height, double width, double height1, double width1);
int main()
{
cout<<"Enter height of rectangle :";
double height,height1;
cin>>height;
cout<<"Enter width of rectangle :";
double width,width1;
cin>>width;
cout<<"Area of rectangle is :"<<Area(height,width)<<endl;
cout<<"Perimeter of rectangle is :"<<Perimeter(height,width,height1,width1)<<endl;
return 0;
}
double Area(double height, double width)
{
return height*width;
}
double Perimeter(double height, double width, double height1, double width1)
{
height=height1;
width=width1;
return height+width+height1+width1;
}
|