-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathareaCalculator.c
33 lines (28 loc) · 1.01 KB
/
areaCalculator.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include <conio.h>
int main()
{
float length;
float breadth;
float radius;
float areaOfRectangle;
float areaOfCircle;
float perimeterOfRectangle;
float circumferenceOfCircle;
printf("Enter length of Rectangel\n");
scanf("%f", &length);
printf("Enter breadth of rectangle\n");
scanf("%f", &breadth);
printf("Enter radius of circle\n");
scanf("%f", &radius);
areaOfRectangle = length * breadth;
perimeterOfRectangle = 2 * (length + breadth); // perimeter of a rectangel = 2(l+b)
areaOfCircle = (22/7) * radius * radius; // area of a circle = pie.rSquare
circumferenceOfCircle = 2 * (22/7) * radius; // circumference of a circle = 2pieR
printf("Area of Rectangel = %f\n", areaOfRectangle);
printf("Perimeter of rectangel = %f\n", perimeterOfRectangle);
printf("Area of Circle = %f\n", areaOfCircle);
printf("Circumference of the circle = %f\n", circumferenceOfCircle);
getch();
return 0;
}