Chapter - 3: The Decision Control

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


C
Sections
9
Exercises

A

B

C

D

E

F

G

H

I

J

K

1

2

3

4

5

6

7

8

9

10

11

12

#include<stdio.h>
#include<conio.h>
int main()
{
	float a,b, area, peri;
	
	printf("Enter the length and breadth of the rectangle : ");
	scanf("%f%f", &a,&b);
	
	area = a*b;
	peri = 2*a + 2*b;
	
	if((area > peri)
		printf("\n\nThe area %f of the rectangle is greater than it's perimenter %f.", area,peri);
	else
		printf("\n\nThe area %f of the rectangle is less than it's perimenter %f.", area,peri);
		
	getch();
	return 0;
}

© 2020 Garbage Valuegarbage value logo