-
Notifications
You must be signed in to change notification settings - Fork 0
/
employee structure.cpp
44 lines (40 loc) · 986 Bytes
/
employee structure.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
#include<iostream>
#include<string.h>
using namespace std;
struct employee
{
int id;
string name;
double marks;
string dept;
};
int main()
{
struct employee data[2];
for (int i = 0; i < 2; i++)
{
cout << "Enter Employee's Data: " << endl;
cout << "===== ========== ===== " << endl;
cout << "Enter the employee's ID: ";
cin >> data[i].id;
cin.ignore();
cout << "Enter the student's name: ";
getline(cin,data[i].name);
cout << "Enter the student's marks: ";
cin >> data[i].marks;
cin.ignore();
cout << "Enter the student's dept: ";
getline(cin, data[i].dept);
}
for (int i = 0 ; i < 2; i++)
{
cout << "Employee's Information: " << endl;
cout << "========== ============ " << endl;
cout << "Employee's ID is : " << data[i].id<< endl;
cout << "Employee's Name is : " << data[i].name << endl;
cout << "Employee's Marks are: " << data[i].marks << endl;
cout << "Employee's Dept is: " << data[i].dept << endl;
cout << endl;
}
return 0;
}