Him
write
a
to find the
C ++ program
and perimeter
of
rectangle
lxb
Answers
Answered by
1
C++ Program to find the perimeter of the rectangle
#include <iostream>
using namespace std;
int main(){
float length, width, perimeter;
cout <<"Enter the Length of the Rectangle =\n";
cin >> length;
cout <<"Enter the Width of the Rectangle =\n";
cin >> width;
perimeter = 2*(length + width);
cout <<"Perimeter of the Rectangle is " << perimeter;
return 0;
}
EXAMPLE OUTPUT
Enter the Length of the Rectangle =
12
Enter the Width of the Rectangle =
5
Perimeter of the Rectangle is 34
Attachments:
Similar questions