Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

d. In what sports does the person consult?

Answered: 1 week ago