Skip to content

luc014.c

Problem Statement

Given the length and breadth of a rectangle, write a program to find whether the area of the rectangle is greater than it's perimeter. For example, the area of the rectangle with length = 5 and breadth = 4 is greater than its perimeter.

Metadata

Property Detail
Author Amit Dutta (amitdutta4255@gmail.com)
License MIT

Actions

Raw View on GitHub

💡 You can print or save this file by opening Raw and using your browser.

Source Code

#include <stdio.h>
int main()
{
    double len, bre, area, peri;
    printf("Enter the length and breadth of the rectangle : ");
    scanf("%lf %lf", &len, &bre);
    area = len * bre;
    peri = 2 * (len + bre);
    if (area > peri)
        printf("\nThe area of the rectangle is greater than it's perimeter.");
    else if (area < peri)
        printf("\nThe area of the rectangle is lower than it's perimeter.");
    else
        printf("\nThe area of the rectangle is same as it's perimeter.");
    return 0;
}