-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_of_hybrid.cpp
More file actions
85 lines (65 loc) · 1.1 KB
/
Copy pathexample_of_hybrid.cpp
File metadata and controls
85 lines (65 loc) · 1.1 KB
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
#include<iostream>
#include<conio.h>
using namespace std;
class first
{
public:
int a,b ;
void accept()
{
cout << "Enter the value of a and b = " ;
cin>>a>>b;
}
};
class second : public first
{
public:
void show()
{
accept ();
cout <<a<<b<<endl;
}
};
class third
{
public:
int x,y;
void sum()
{
cout << "enter tha values of x and y = " ;
cin>>x>>y;
cout << "sum of given numbers = " <<x+y<<endl;
}
};
class fourth : public third
{
public:
int A,B;
void mul()
{
cout << "Enter the values of A and B = ";
cin >> A>>B;
cout << "sum of A and B = " <<A+B<<endl;
}
};
class five : public fourth
{
public :
float p,m;
void dev()
{
cout << "Enter the value of p and m = " ;
cin >> p>>m;
cout << "Division of p and m "<<p/m<<endl ;
}
};
int main()
{
second obj;
obj.show();
five obj1;
obj1.dev();
obj1.mul();
obj1.sum();
return 0;
}