-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlec4.cpp
66 lines (58 loc) Β· 883 Bytes
/
lec4.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
#include<iostream>
using namespace std;
class Human
{
private:
int a;
protected :
int b;
public:
int c;
void display()
{
cout<<a<<endl;
cout<<b<<endl;
cout<<c<<endl;
}
};
class Person
{
string religion , color;
public:
string name;
int age , weight;
};
class Student : protected Person
{
int roll_no, fees;
public:
void fun(string n , int a , int w)
{
name = n;
age = a;
weight = w;
}
void display()
{
cout<<name<<endl;
cout<<age<<endl;
cout<<weight<<endl;
}
};
class Teacher: public Person
{
int salary , id;
public:
};
int main()
{
// Human h1;
// h1.a = 10;
// h1.b = 20;
// h1.c = 30;
// h1.display();
Student A;
//A.name = "abc";
A.fun("abc" , 10 , 20);
return 0;
}