-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEmployee.cpp
More file actions
39 lines (39 loc) · 737 Bytes
/
Employee.cpp
File metadata and controls
39 lines (39 loc) · 737 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
#include<iostream>
using namespace std;
float inc(float sal,int exp)
{
if((2014-exp)>=10)
return (sal*10/100);
else
return (sal*5/100);
}
struct emp
{
int exp;
char name[20];
float sal;
};
int main()
{
emp e[10];
int i;
cout<<"Enter Employee Details :-";
for(i=0;i<10;i++)
{
cout<<"\n\nEmployee : "<<i+1;
cout<<"\nName: ";
cin>>e[i].name;
cout<<"Year of joining : ";
cin>>e[i].exp;
cout<<"Salary : ";
cin>>e[i].sal;
}
cout<<"\n\nNEW Details :-";
for(i=0;i<10;i++)
{
e[i].sal+=inc(e[i].sal,e[i].exp);
cout<<"\n\nName : "<<e[i].name;
cout<<"\nSalary : "<<e[i].sal;
}
return 0;
}