-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtut43.cpp
74 lines (66 loc) · 1.07 KB
/
tut43.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include<iostream>
using namespace std;
void name(){
cout<<'Author: Varun Gupta'<<endl;
}
class base1
{
protected:
int a;
public:
void show()
{
cout<<"This is from class base1 "<<endl;
}
};
class base2
{
protected:
int b;
public:
void show()
{
cout<<"This is from class base2 "<<endl;
}
};
class Derived :public base1, public base2
{
protected:
int i;
public:
void show()
{
base1::show();
// base2::show();
}
};
class A
{
protected:
int a;
public:
void display()
{
a=10;
cout<<"The values of a is :"<<a<<endl;
}
};
class B:public A
{
protected:
int b=20;
public:
// void display()
// {
// cout<<"The value of b is "<<b<<endl;
// }
};
int main(){
name();
Derived d;
d.show();
A a;
B b;
b.display();
return 0;
}