Maximum area of rectangle possible with given perimeter | C ++ to find maximum area rectangle ; Function to find max area ; return area ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int maxArea ( float perimeter ) { int length = ( int ) ceil ( perimeter / 4 ) ; int breadth = ( int ) floor ( perimeter / 4 ) ; return length * breadth ; } int main ( ) { float n = 38 ; cout << " Maximum ▁ Area ▁ = ▁ " << maxArea ( n ) ; return 0 ; }