C Program to Sort Records
This is the C Program to sort records of the students according to their names
Program can be modified to sort according to marks or any criteria
[cc lang=”c”]
#include
#include
struct person
{
char name[10];
};
typedef struct person NAME;
NAME stud[10], temp[10];
void main()
{
int no,i;
printf(“Enter the number of students in the listn”);
scanf(“%d”,&no);
for(i=0;i
{
temp=stud[i];
stud[i]=stud[j];
stud[j] = temp;
}
}
}
}
[/cc]
Recent Comments