Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <cstdio>
  4. #include <cstring>
  5. struct person
  6. {
  7.     char lastname[64];
  8.     char firstname[64];
  9.     char post[64];
  10.     int salary;
  11. };
  12.  
  13.  
  14. int main() {
  15.  
  16.     const int amountOfWorkers = 3;
  17.     person p[amountOfWorkers] = {};
  18.  
  19.     for (int i = 0; i < amountOfWorkers; i++)
  20.     {
  21.         printf("Enter firstname: ");
  22.         scanf("%s", p[i].firstname);
  23.  
  24.         printf("Enter lastname: ");
  25.         scanf("%s", p[i].lastname);
  26.  
  27.         printf("Enter post:");
  28.         scanf("%s", p[i].post);
  29.  
  30.         printf("Enter salary:");
  31.         scanf("%d", p[i].salary);
  32.     }
  33. }
  34.  
  35. void showData()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement