You are on page 1of 1

1.

Write a program in C language that performs the tasks listed below:


∙ Define two structures named Date and Student.
Member variables of the structures are shown in the following table:
Structure Members

Date Day, Month, Year

Student Roll, Name, DOB


(DOB is an instance of Date structure)

∙ The information will be stored in a file named “student_input.txt”. The first line is an
integer n as denoting the number of Student instances. After that, take the
information of n number of students as input from the same file and store all the
instances of Student in an array.
∙ Construct a function named “Compare” that will take two Student instances as
parameters.
∙ Take two integers i and j as input from file and call the “Compare” function by
passing the i-th and j-th instances of the Student array. Which means that the
Compare function will compare between two Student instances who are located in
the i-th and j-th index of the array. Now, print the information of the student who
was born earlier and store his/her information in a file named “student_output.txt”.
If both students are of the same age, then print and store both students' information.

You might also like