Given The Length And Breadth Of A Rectangle, Write A Program To Find Whether The Area Of The Rectangle Is Greater Than Its Perimeter - Code With Friends

Breaking

Home Top Ad

Search Your Questions

Wednesday, February 27, 2019

Given The Length And Breadth Of A Rectangle, Write A Program To Find Whether The Area Of The Rectangle Is Greater Than Its Perimeter

#include<stdio.h>
int main()
{
    int length,breadth,area,perimeter,dif;

    printf("Enter a your length and breadth of a rectangle ");
    scanf("%d %d",&length,&breadth);
    area=length*breadth;
    perimeter=2*(length+breadth);
    if  (area>perimeter)
    {
        area=area-perimeter;
        printf("Area is greater than perimeter ");
    }
    else
    {
        if(perimeter>area);
        {
            perimeter=perimeter-area;
            printf("Perimeter is greater than area");
        }
    }
}




No comments:

Post a Comment