-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy paths.c
More file actions
40 lines (40 loc) · 825 Bytes
/
s.c
File metadata and controls
40 lines (40 loc) · 825 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
40
# include<stdio.h>
struct emp
{
int id;
char name[20];
char dept[20];
float sal;
};
void main()
{
struct emp e[5];
int n,i;
FILE *fp;
printf("enter the no. to inseart");
scanf("%d",&n);
fp=fopen("c\\VIVEK SAHU (2).xlsx","a");
for(i=0;i<n;i++)
{
printf("\n enter the %d employee id :",i+1);
scanf("%d",&e[i].id);
fflush(stdin);
printf("\n enter the %d employee name :",i+1);
gets(e[i].name);
printf("\n enter the %d employee department :",i+1);
gets(e[i].dept);
printf("\n enter the %d employee salary :",i+1);
scanf("%f",&e[i].sal);
}
fclose(fp);
fp=fopen("c\\VIVEK SAHU (2).xlsx","r");
for(i=0;i<n;i++)
{
puts(e[i].name);
printf("\n : %d ",e[i].id);
printf("\n");
puts(e[i].dept);
printf("\n");
printf("\n : %f ",e[i].sal);
}
}