counter

Free Hit Counter

C program to compare area and perimeter


Q:Given the length and breadth of rectangular,write a program to find whether the area of the rectangle is greater than its perimeter.

#include
#include
void main()
{
int l,b,a,p;
clrscr();
printf("enter the length: ");
scanf("%d",&l);
printf("enter the bragth: ");
scanf("%d",&b);
a=l*b;
p=2*l+2*b;
if(a>p)
{
printf("area is big");
}
else
{
printf("perameter is big");
}
getch();
}

No comments:

Post a Comment