Advertisement
Susri

3rd semester1

Jan 18th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include<stdio.h>
  2. struct employee {
  3.     char name[30];
  4.     int id;
  5.     float salary;
  6.  
  7. };
  8. int main(void)
  9. {
  10.     struct employee em[5];
  11.     int i;
  12.     for(i=0;i<5;i++)
  13.     {
  14.         printf("Information of employee : %d \n",i+1);
  15.         fflush(stdin);
  16.         gets(em[i].name);
  17.         scanf("%d",&em[i].id);
  18.         scanf("%f",&em[i].salary);
  19.     }
  20.     for(i=0;i<5;i++)
  21.  
  22.  
  23.     {
  24. printf("Name: %s\n",em[i].name);
  25.  
  26.         printf("Id number: %d\n",em[i].id);
  27.         printf("Salary: %.2f\n",em[i].salary);
  28.     }
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement