-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathemployee.c
More file actions
33 lines (26 loc) · 938 Bytes
/
employee.c
File metadata and controls
33 lines (26 loc) · 938 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
**To enter details of employee**
#include<stdio.h>
#include<string.h>
struct employee
{
int code;
char name[25],department[15];
float salary;
};
void main()
{
struct employee aemployee;
printf("Enter employee code \n");
scanf("%d",&aemployee.code);
printf("Enter employee's name \n");
scanf("%s",&aemployee.name);
printf("Enter employee's department \n");
scanf("%s",&aemployee.department);
printf("Enter employee salary \n");
scanf("%f",&aemployee.salary);
printf("Particulars of employee are :\n");
printf("\n Employee's code %d",aemployee.code);
printf("\n Employee's name %s",aemployee.name);
printf("\n Employee's department %s",aemployee.department);
printf("\n Employee salary %2f \n ",aemployee.salary);
}