Skip to content

Commit 3d91d52

Browse files
authoredFeb 3, 2021
Add files via upload
1 parent b35d340 commit 3d91d52

File tree

2 files changed

+95
-0
lines changed

2 files changed

+95
-0
lines changed
 

‎OVERLOAD.CPP

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#include<iostream.h>
2+
#include<conio.h>
3+
4+
int volume(int s)
5+
{
6+
int temp;
7+
temp=s*s*s;
8+
return temp;
9+
}
10+
double volume(double r,int h)
11+
{
12+
double temp;
13+
temp=3.14*r*r*h;
14+
return temp;
15+
}
16+
long volume(long r,int b,int h)
17+
{
18+
long temp;
19+
temp=r*b*h;
20+
return temp;
21+
}
22+
void main()
23+
{
24+
clrscr();
25+
int ans,a;
26+
double res,b,c;
27+
long res1,d,e,f;
28+
29+
cout<<"Enter a number to find volume of cube:"<<endl;
30+
cin>>a;
31+
ans=volume(a);
32+
cout<<"Volume of cube is:"<<ans<<endl;
33+
34+
cout<<"Enter numbers to find volume of cylinder:"<<endl;
35+
cin>>b>>c;
36+
res=volume(b,c);
37+
cout<<"Volume of cylinder is:"<<res<<endl;
38+
39+
cout<<"Enter numbers to find volume of rectangular box:"<<endl;
40+
cin>>d>>e>>f;
41+
res1=volume(d,e,f);
42+
cout<<"Volume of rectangular box is:"<<res1<<endl;
43+
getch();
44+
45+
}

‎OVERLO~1.CPP

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#include<iostream.h>
2+
#include<conio.h>
3+
4+
int add(int a, int b)
5+
{
6+
int temp;
7+
temp=a+b;
8+
return temp;
9+
}
10+
11+
int add(int a, int b, int c)
12+
{
13+
int temp;
14+
temp=a+b+c;
15+
return temp;
16+
}
17+
18+
double add(double x , double y)
19+
{
20+
int temp;
21+
temp=x+y;
22+
return temp;
23+
}
24+
25+
double add(int p, double q)
26+
{
27+
double temp;
28+
temp=p+q;
29+
return temp;
30+
}
31+
32+
double add(double p, int q)
33+
{
34+
double temp;
35+
temp=p+q;
36+
return temp;
37+
}
38+
39+
void main()
40+
{
41+
clrscr();
42+
43+
cout<<add(5,10)<<endl;
44+
cout<<add(15,12.5)<<endl;
45+
cout<<add(14.5,13.8)<<endl;
46+
cout<<add(5,10,15)<<endl;
47+
cout<<add(1.5,8)<<endl;
48+
49+
getch();
50+
}

0 commit comments

Comments
 (0)
Please sign in to comment.