C++ Program to Find Perimeter of Rectangle

Write C++ Program to Find Perimeter of Rectangle

// CPP Program to Find Perimeter of Rectangle

#include <iostream>

using namespace std;

int main()
{
    float length, breadth, Perimeter;

	cout << "Enter the length :--> ";
	cin >> length;

    cout << "Enter the breadth :--> ";
	cin >> breadth;

	//Formula to find the perimeter of Rectangle
    Perimeter = 2 * (length + breadth);

    cout << "Perimeter of Rectangle :--> " << Perimeter;

    return 0;
}

Output:

Enter the length :--> 20
Enter the breadth :--> 10

Perimeter of Rectangle :--> 60.00

≪ Previous | Next ≫