Answer to Question #251308 in C for Samzzy

Question #251308
write a program that creates a structure template with two members according to the following criteria: the first member is a student number (following the format of 10 digits: yyyymm wxyz yyyy = birth year, on = birth month, wxyz = random 4 digit code) the second member is a structure with three members according to the following criteria: first member is "first name" second member is "middle name" third member is "last name" write and test a program that creates and initializes an array of five of these structures (make up pretend names/numbers for your 5 students). write a single function that accepts the array of structures as its parameter for printing the array data in the following format:
1
Expert's answer
2021-10-16T11:02:42-0400
#include <stdio.h>

struct NAME {
  char first[10];
  char middle[10];     
  char last[15];
}; 

struct PERSON {
  char SSN[10]; 
  struct NAME name; };

typedef struct PERSON person

void printpeople(person[], int);
person read() {
  return (parson) { .SSN = ssn, { .first = first, .middle = middle, .last = last }};
}

person[10];

int main() {
  for (int i = 0; i < 10; i++) {
    person[i] = read();
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS