-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path47.cpp
42 lines (40 loc) · 780 Bytes
/
47.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
//Employee.
#include<iostream>
using namespace std;
class employee
{
int ID,salary;
char name[10];
public:
void getdata()
{
cout<< "\nEnter ID: ";
cin>> ID;
cout<< "Enter Name: ";
cin>> name;
cout<< "Enter Salary: ";
cin>> salary;
}
void show()
{
cout<< "\n\nID: " << ID;
cout<< "\nName: " << name;
cout<< "\nSalary: " << salary;
}
};
int main()
{
int i,no;
cout<< "Enter No. of Employees: ";
cin>> no;
employee e[10];
for(int i=0;i<no;i++)
{
e[i].getdata();
}
for(i=0;i<no;i++)
{
e[i].show();
}
return 0;
}