-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverloading.cpp
More file actions
51 lines (39 loc) · 792 Bytes
/
Copy pathoverloading.cpp
File metadata and controls
51 lines (39 loc) · 792 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<iostream>
#include<conio.h>
using namespace std;
void sum(int a[])
{
int i,sum=0;
for(i=0;i<4;i++)
{
sum=sum+a[i];
}
cout<<" addition = "<<sum;
}
void sum(float a[])
{
float sum=0;
int i;
for(i=0;i<4;i++)
{
sum=sum+a[i];
}
cout <<endl<< "addition = " <<sum;
}
int main ()
{
int a[10],i;
cout << "enter array element 10 = " ;
for(i=0;i<10;i++)
{
cin >> a[i];
}
float b[4];
cout << "enter 4 float Elements = " ;
for(i=0;i<4;i++)
{
cin >> b[i];
}
sum(a);
sum(b);
}