-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructure_input.c
More file actions
48 lines (40 loc) · 1.43 KB
/
structure_input.c
File metadata and controls
48 lines (40 loc) · 1.43 KB
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
44
45
46
47
48
#include <stdio.h>
#include <string.h>
struct employee
{
int code;
float Salary;
char name[10];
};
int main()
{
struct employee e1, e2, e3;
printf("Enter the code of Employee e1 is: \n");
scanf("%s", &e1.code);
printf("Enter the Salary of Employee e1 is: \n");
scanf("%f", &e1.Salary);
printf("Enter the Name of Employee e1 is: \n");
scanf("%s", e1.name);
printf("Enter the code of Employee e2 is: \n");
scanf("%s", &e2.code);
printf("Enter the Salary of Employee e2 is: \n");
scanf("%f", &e2.Salary);
printf("Enter the Name of Employee e2 is: \n");
scanf("%s", e2.name);
printf("Enter the code of Employee e3 is: \n");
scanf("%s", &e3.code);
printf("Enter the Salary of Employee e3 is: \n");
scanf("%f", &e3.Salary);
printf("Enter the Name of Employee e3 is: \n");
scanf("%s", e3.name);
printf("The name of Employee E1 is %s\n", e1.name);
printf("The Code of Employee E1 is %d\n", e1.code);
printf("The salary of Employee E1 is %d\n", e1.Salary);
printf("The name of Employee E1 is %s\n", e2.name);
printf("The Code of Employee E1 is %d\n", e2.code);
printf("The salary of Employee E1 is %d\n", e2.Salary);
printf("The name of Employee E1 is %s\n", e3.name);
printf("The Code of Employee E1 is %d\n", e3.code);
printf("The salary of Employee E1 is %d\n", e3.Salary);
return 0;
}