Code:

#include <stdio.h>
#include <string.h>
void printmenu ()
{
printf("MENU\n1 - Sort by Name (Alphabetically)\n2 - Sort by Age (Ascending Order)\n3- Sort by GPA (Descending Order)\n4 - Quit\n");
}
void printData(char *name[],int age[],float gpa[],int n)
{
for (n=0;n<10;n++)
printf("Name\tAge\tGPA\t\n========================\n%s\t%i\t%f\t",*name[n],age[n],gpa[n]);
}
void sortByName(char *a[], int n)
{
int i, j;
char *temp;
for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
if(strcmp(a[i],a[j]) > 0)
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
void sortByAge(int a[], int n)
{
int i, j;
int temp;
for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
if(a[i] < a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
void sortByGPA(int a[], int n)
{
int i, j;
float temp;
for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
if(a[i] > a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
main ()
{
char *name[10]={"Gerrard","Reina","Torres","Kuyt","Babel","Carragher","Alonso","Skrtel","Mascherano","Benayoun"};
int age[10]={22,28,23,21,27,19,20,25,18,24};
float gpa[10]={4.00,3.54,3.21,3.11,2.45,2.67,3.92,2.14,3.76,3.01};
int selec;
int n=10;
printmenu ();
scanf("%i",&selec);
if (selec>4)
{
switch (selec)
{
case1:sortByName(name,n);
printData (name,age,gpa,n);
break;
case2:sortByAge(age,n);
printData (name,age,gpa,n);
break;
case3:sortByGPA(gpa,n);
printData (name,age,gpa,n);
break;
case4:exit(0);
break;
default:printf("Error - Retry");
break;
}
}
return 0;
}