7-4-2006

Write a C program to do the following:

a) Define a structure type called stype that can hold a student name, roll number, and mobile #. Define an array sarr of size 100 of pointers of stype.

b) Write a function read that reads a student record from user and stores at an appropriate place in sarr (Hint: dynamically allocate storage)

c) Write a function print that can print the contents in sarr properly formatted.

d) Write a function sort that can sort the sarr either by student roll# or mobile# as required.

e) Write a main program to read upto 5 student records, print the entered values as it is, and print after sorting in terms of roll#, and in terms of mobile#.