forked from sat5297/hacktober-coding
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CalculateArea.cpp
51 lines (44 loc) · 879 Bytes
/
CalculateArea.cpp
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
float a, b, radius, area;
int ch;
cout << "\n1.Area Of Rectangle";
cout << "\n2.Area Of Square";
cout << "\n3.Area Of Circle\n";
cout<<"\nEnter Your Choice :";
cin>>ch;
switch(ch)
{
case 1:
{
cout << "\nEnter the Length and Breadth of Rectangle: ";
cin >> a >> b;
area = a*b;
cout << "Area of Rectangle = " << area << endl;
break;
}
case 2:
{
cout << "\nEnter Side of Square: ";
cin >> a;
area = a*a;
cout << "Area of Square = " << area << endl;
break;
}
case 3:
{
cout << "\nEnter the Radius of Circle: ";
cin >> radius;
area = 3.14159*radius*radius;
cout << "Area of Circle = " << area << endl;
break;
}
default:
cout<<"\n Invalid Choice Try Again...!!!";
break;
}
return 0;
}