Advertisement
Guest User

structure

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