Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- struct employee {
- char name[30];
- int id;
- float salary;
- };
- int main(void)
- {
- struct employee em[5];
- int i;
- for(i=0;i<5;i++)
- {
- printf("Information of employee : %d \n",i+1);
- fflush(stdin);
- gets(em[i].name);
- scanf("%d",&em[i].id);
- scanf("%f",&em[i].salary);
- }
- for(i=0;i<5;i++)
- {
- printf("Name: %s\n",em[i].name);
- printf("Id number: %d\n",em[i].id);
- printf("Salary: %.2f\n",em[i].salary);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement