-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFunctionOverloading.cpp
54 lines (50 loc) · 1.19 KB
/
FunctionOverloading.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
51
52
53
54
#include<iostream>
#include<conio.h>
using namespace std;
float area (int ,int); //1st function and define scope 20 to 22 1st and 2nd fun are correct
int area(int, int,int); //2nd function scope 24 to 29
void area(); //3rd fun scope 31 to 37
int read();
float calculate(int);
void display(float); //call inside 3rd fun and scope 38 to 44
int main()
{
int l,b;
cout<<"Enter Two Values"<<endl;
cin>>l>>b;
cout<<"1st Area of RightAngle:-"<<area(l,b)<<endl;
cout<<"2nd area function:-"<<area(3,4,5)<<endl;
area();
//cout<<area();
return 0;
}
float area(int l,int b)
{
return (.5*l*b);
}
int area(int a,int b,int c)
{
return a*b*c;
}
void area()
{ float result;
int r,x;
r=read();
result=calculate(r);
display(result);
}
int read()
{
int r;
cout<<"Enter Value of circle:-";
cin>>r;
return (r);
}
float calculate(int a)
{
return (3.14*a*a);
}
void display(float result)
{
cout<<"Area of circule:-"<<result;
}