-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEmployeeDetailTable.cpp
42 lines (39 loc) · 1.13 KB
/
EmployeeDetailTable.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
#include<iostream>
#include<iomanip>
using namespace std;
struct Employee{
int EmpId;
char EmpName[50];
int EmpSalary;
char EmpDepartement[50];
};
int main()
{
int n;
Employee Emp[n];
cout<<"Enter number of employee : ";
cin>>n;
cout<<"\n";
for(int i=0;i<=n;i++)
{
cout << "\nEnter details of " << i+1 << " Employee"<<endl;
cout <<setw(5)<< "\nEnter Employee Id : ";
cin >> Emp[i].EmpId;
cout <<setw(5)<< "\nEnter Employee Name : ";
cin >> Emp[i].EmpName;
cout <<setw(5)<< "\nEnter Employee Departement : ";
cin >> Emp[i].EmpDepartement;
cout <<setw(5)<< "\nEnter Employee Salary : ";
cin >> Emp[i].EmpSalary;
}
cout<<"\n\n------------------------------------------------------------\n";
cout << "Details of Employees";
cout<<"\n------------------------------------------------------------\n\n";
cout << "EmpID" <<setw(15)<<"EmpName" <<setw(10)<<"EmpDepartement" <<setw(10)<<"EmpSalary";
cout<<endl;
for(int i=0;i<n;i++)
{
cout << "\n"<< Emp[i].EmpId <<setw(15)<< Emp[i].EmpName <<setw(10)<< Emp[i].EmpDepartement <<setw(10)<< Emp[i].EmpSalary;
}
return 0;
}