Question: Modify the struct declaration for person by adding a city of residence of type char[40]. Modify the program by adding 5 more individuals to the

Modify the struct declaration for person by adding a city of residence of type char[40]. Modify the program by adding 5 more individuals to the group[] array. For each individual add the new field for the city of residence. Please make up arbitrary data for this step. Modify the program to print in a loop. (make sure it handles the city of residence also). Run the program and redirect output to a file.

#include #include

typedef struct { int idnumber; char name[24]; int birthmonth; int birthday; int birthyear; } person;

int main( ) {

person group[] = {289013, "John Doe", 7, 4, 1776, 6823, "Jane Doe", 2, 28, 1987, 54901, "Jose Cortes", 12, 1, 2005};

printf ("%-8d %-20s %02d-%02d-%04d ", group[0].idnumber, group[0].name, group[0].birthmonth, group[0].birthday, group[0].birthyear);

printf ("%-8d %-20s %02d-%02d-%04d ", group[1].idnumber, group[1].name, group[1].birthmonth, group[1].birthday, group[1].birthyear);

printf ("%-8d %-20s %02d-%02d-%04d ", group[2].idnumber, group[2].name, group[2].birthmonth, group[2].birthday, group[2].birthyear);

return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!