-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut24.cpp
More file actions
43 lines (37 loc) · 745 Bytes
/
tut24.cpp
File metadata and controls
43 lines (37 loc) · 745 Bytes
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
#include <iostream>
using namespace std;
class Employee
{
int id;
static int count;
public:
void setData(void)
{
cout << "Enter the Employee id" << endl;
cin >> id;
count++;
}
void getData(void)
{
cout << "The Employee id is " << id << " and employee number is " << count << endl;
}
static void getcount(void)
{
cout << "The count number is :" << count << endl;
}
};
int Employee ::count;
int main()
{
Employee ritik, ritu, kajal;
ritik.setData();
ritik.getData();
Employee ::getcount();
ritu.setData();
ritu.getData();
Employee ::getcount();
kajal.setData();
kajal.getData();
Employee ::getcount();
return 0;
}