-
Notifications
You must be signed in to change notification settings - Fork 1
/
SampleCPP.cpp
102 lines (76 loc) · 1022 Bytes
/
SampleCPP.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
class Parent1
{
int a=6, b, c=10;
string myStr = "sehaj", noStr="Singh";
};
class Parent2
{
int a=6, b, c=10;
int x,y,z=10;
int method1()
{
Cout<<"method 1 output";
}
int method2()
{
double dbl=98, yeah;
Cout<<"method 2 output";
}
};
class Parent3
{
};
class Super
{
int method1(){
int ab = 10;
string s = "inside method1";
cout<<"Test output";
}
};
class Intermediate : public Super
{
int a = 0;
string s = "hello";
int method2(){
cout<<"Test output 1";
}
};
class Child1 : public Parent1 , private Parent2
{
int sehaj;
double Gagandeep;
};
class Child2 : public Parent3
{
int acc;
void method3()
{
cout<<"method 3 output"
}
};
class Child3 : protected Parent2 , public Parent3
{
int ase, ns=69;
};
class Child4 : private Parent2
{
float method4(int a)
{
}int acc;
void child4_method()
{
}
};
class Base : public Intermediate
{
int ab = 10;
double xy = 55;
char c;
int method3(){
cout<<"Test output 2";
}
char method5(){
out<<"Test output 5";
}
};