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;i0)
{
temp=stud[i];
stud[i]=stud[j];
stud[j] = temp;
}
}
}
}
[/cc]

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *