please help me by doing the following program.
I want to feed 80 students name,gender and CGPA.and want to sort in two cases.case 1 sorting with respect to their name
case 2 sorting with respect to their CGPA.
I would stat it like this.
*******************************
#include<iostream.h>
void main()
{
char name[20];
char gender[80];
int CGPA[80];
for(int i=0;i<80;i++)
{
cout<<"enter the name of student:"<<i+1<<endl;
cin>>name;
cout<<"enter the gender of student"<<i+1<<endl;
cin>>gender;
cout<<"enter the CGPA of student"<<i+1<<endl;
cin>>CGPA;
}
}
I want to do it like.
enter name of student 1:
enter gender of student 1:
enter CGPA of student 1;
for each 80 students,but I encountered a problem how can I solve it and sort it?