Question: CSE 1 2 1 - - Introduction to C Programming Assignment # 7 Name your program: p 7 . c This week we

CSE 121-- Introduction to "C"
Programming Assignment #7
Name your program: p7.c
This week we will work with the "struct" feature, and apply a basic sorting function to
an array of structures.
code for these
functions after your
main function.
void print_person_info(struct person clone);
void sort_by_age(nt n, struct person a[]);
int main (void){
int i,n=5;
struct person student[5]=
{
{"Bob", "Smith", 21},
{"Jimmy", "John", 18},
{"Amy", "Goldberg", 20},
{"Dan", "Marlo", 17},
{"Sally", "Sorrow", 16}
} ;
The sort_by_age
function should sort
the students, so as
the youngest is
placed in student[0],
and the oldest is
placed in student[4].
for(i=0;i1i=0;i
printpersoninfo(student[i]);
return 0 ;
n, student
 CSE 121-- Introduction to "C" Programming Assignment #7 Name your program:

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!