-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut41.cpp
More file actions
52 lines (46 loc) · 900 Bytes
/
tut41.cpp
File metadata and controls
52 lines (46 loc) · 900 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
52
#include <iostream>
using namespace std;
class base{
protected:
int baseint1;
public:
void setbaseint1(int a)
{
baseint1 = a ;
}
};
class base2{
protected:
int baseint2;
public:
void setbaseint2(int a){
baseint2 = a ;
}
};
class base3{
protected:
int baseint3;
public:
void setbaseint3(int a){
baseint3 = a ;
}
};
class deriev : public base, public base2,public base3{
public:
void show()
{
cout<<"The value of the base1 is "<<baseint1<<endl;
cout<<"The value of the base2 is "<<baseint2<<endl;
cout<<"The value of the base3 is "<<baseint3<<endl;
cout<<"The sum of the bases is "<<baseint1 + baseint2 + baseint3<<endl;
}
};
int main()
{
deriev p ;
p.setbaseint1(33);
p.setbaseint2(35);
p.setbaseint3(67);
p.show();
return 0;
}