forked from sat5297/hacktober-coding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharea.c
More file actions
34 lines (33 loc) · 697 Bytes
/
area.c
File metadata and controls
34 lines (33 loc) · 697 Bytes
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
34
//area of rectangle,circle and square
#include<stdioh>
void main()
{
int n;
int l,b,radius,side;
int area;
printf("1) RECTANGLE\n");
printf("2) CIRCLE\n");
printf("3) SQUARE\n");
printf("Enter a choice\n");
scanf("%d",&n);
printf("The area is : %d")
switch(n)
{
case 1: printf("Enter length and breadth\n");
scanf("%d%d",&l,&b);
area=l*b;
printf("%d\n",area);
break;
case 2: printf("Enter radius\n");
scanf("%d",&radius);
area=3.14*radius*radius;
printf("%d\n",area);
break;
case 3: printf("Enter the side length\n");
scanf("%d",&side);
area=side*side;
printf("%d\n",area);
break;
default:printf("Invalid choice,please try again\n");
}
}