Thursday, 17 October 2013

CPP Program to Calculate Perimeter of Rectangle

//Write a program to calculate perimeter of rectangle.
#include<iostream.h>
#include<conio.h>
void main()
{
 clrscr();
 int l,b,peri;
 cout<<"Enter length -";
 cin>>l;
 cout<<"Enter breadth -";
 cin>>b;
 peri=2*(l+b);
 cout<<"Perimeter of rectangle -"<<peri;
 getch(); 
}

Output:
 

No comments:

Comments System