Create record of student details using structure

Record is collection of data items of different data types.In this program,a record is created using structure.Structure stud is created which stores student details such as roll no,name and percentage.First the details of students are accepted and saved in structure.Then the structure is sorted as per the percentage of the students.Sorting is done is using simple sorting where temp variable is used for swapping the record positions.

#include < stdio.h >
#include < conio.h > 
#include < math.h>
#include < stdlib.h>

struct stud
{
	int roll;
	char name[15];
	float per;
};

void main()
{
	struct stud a[50], t;
	int i, j, n;

	clrscr();

	printf("\n C Language Program to implement a Simple Sort Struct type Array");
	printf("\n To sort the Student Records in Dercreasing Order of % (Percentage) \n");
	printf("\n Enter How Many Records [ i.e. Size of Array (n) ] : ");
	scanf("%d",  &n);
	read_data(a, n);

	printf("\n %d Records Before Sorting are \n", n);
	print_data(a, n);

	simple_sort(a, n);

	printf("\n %d Values After Sorting are \n", n);
	print_data(a, n);

} // main

int read_data( struct stud a[], int n )
{
	int i;
	float t;

	printf("\n Enter %d Records \n", n);
	for(i = 0; i < n; i++)
	{
		printf("\n Roll No. : ");
		scanf("%d", &a[i].roll);
		printf("\n Name : ");
		flushall();
		gets(a[i].name);
		printf("\n Percentage (%) : ");
		scanf("%f", &t);
		a[i].per = t;
	} // for
	return;
} // read_data

int print_data( struct stud a[], int n )
{
	int i;
	float t;

	printf("\n Roll No. \t Name \t Percentage (%) \n");
	for(i = 0; i < n; i++)
		printf("\n \t %d \t %s \t %.2f", a[i].roll, a[i].name, a[i].per);
	return;
} // print_data

int simple_sort( struct stud a[], int n )
{
	int i,j;
	struct stud t;

	for(i = 0; i < n-1; i++)
	{
		for(j = i+1; j < n; j++)
		{
			if( a[i].per < a[j].per)
			{
				t = a[i];
				a[i] = a[j];
				a[j] = t;
			} // if
		} // for
	} // for
	return;
} // simple_sort