-
Notifications
You must be signed in to change notification settings - Fork 1
/
16.cpp
58 lines (49 loc) · 1 KB
/
16.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
//WAP for implementing multiple inheritance concept using classes.
#include<iostream>
#include<string>
using namespace std;
class teacher
{
public:
char sagar(char mohit)
{
cout << "\n\nEnter Teacher's Initials: ";
cin >> mohit;
cout << "Teacher's Initials: ";
cout << mohit;
}
};
class chor
{
public:
void prince()
{
cout<< "\n\nSagar is a Bad Boy";
}
};
class students: teacher,chor
{
public:
string name;
int roll_no;
int age;
void displaydata(char mohit)
{
cout << "\nStudent Roll No.: "<< roll_no << "\nStudent Name: "<< name << "\nStudent Age: "<< age;
sagar(mohit);
prince();
}
};
int main()
{
char mohit;
students one;
cout<< "Enter Student Roll No.: ";
cin>> one.roll_no;
cout<< "Enter Student Name: ";
cin>> one.name;
cout<< "Enter Student Age: ";
cin>> one.age;
one.displaydata(mohit);
return 0;
}