-
Notifications
You must be signed in to change notification settings - Fork 18
/
new16.cpp
34 lines (32 loc) · 851 Bytes
/
new16.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
//function overload
#include<iostream>
using namespace std;
//sum of 2 integers
int sum(int a , float b){
return (a+b);
}
//sum of 3 integers
float sum(int a , float b, int c){
return (a+b+c);
}
//volume of cube
int vol(int a){
return (a*a*a);
}
//volume of cuboid
int vol(int a,int b,int c){
return (a*b*c);
}
//volume of cylinder
int vol(double a,int b){
return (3.14*a*a*b);
}
int main()
{
cout<<"the sumof the numbers 4,5.213 is "<<sum(4,5.213)<<endl;
cout<<"the sumof the numbers 4,6.2165 & 5 is "<<sum(4,6.2165,5)<<endl;
cout<<"the volume of cube with side 4 is "<<vol(4)<<endl;
cout<<"the volume of cuboid with lenght 4 breadth is 5 and height 6 is "<<vol(4,5,6)<<endl;
cout<<"the volume of cylinder with radius 4 and height 5 is "<<vol(4,5)<<endl;
return 0;
}