C++ Program to Find The Perimeter And Area of Rectangle

C++ Program to Find The Perimeter And Area of Rectangle

source code :

//wap to find the perimeter and area of rectangle
#include<iostream>
using namespace std;
int main(){
    float l,b,p,a;
    cout<<"ENter the length of rectangle : "<<endl;
    cin>>l;
    cout<<"ENter the breadth of rectangle : "<<endl;
    cin>>b;
    p=2*(l+b);
    cout<<"THe perimeter of rectangle is : "<<p<<endl;
    a=l*b;
    cout<<"The area of rectangle is : "<<a<<endl;
    return 0;


}

Output :

 

Previous
Next Post »