#include<stdio.h>
#include<database.h>
#define s 60
int sn[s],cn[s],s1[s],s2[s],s3[s],mo[s],gr[s],ex[s];
float page[s];
double cav;
void main()
{
int m,j,t,e;
char ch;
clrscr();
printf("Enter NUMBER of Students in the CLASS:");
scanf("%d",&m);
for(j=0;j<m;j++)
{
inputs(cn,s1,s2,s3,j);
mao(mo,s1,s2,s3,j);
age(page,mo,j);
gra(gr,page,j);
}
cav=cavg(mo,m);
display(sn,cn,s1,s2,s3,mo,page,gr,m,cav);
printf("\n\nDo You Want to See who is TOPPER & who is NULL ?(Y/N)");
ch=getch();
if(ch=='y' || ch=='Y')
first_last(mo,cn,m);
else
printf("\nOK");
printf("\n\nDo You Want to Sort the Table w.r.t T.MARKS ?(Y/N)");
ch=getch();
if(ch=='y' || ch=='Y')
{
printf("\nPress 'a' for ASCENDING ORDER & 'd' for DESCENDING ORDER");
ch=getch();
if(ch=='a' || ch=='A')
{
sortA_mao(cn,s1,s2,s3,mo,page,gr,ex,m);
S_display(cn,s1,s2,s3,mo,page,gr,m,cav);
}
else
{
sortD_mao(cn,s1,s2,s3,mo,page,gr,ex,m);
S_display(cn,s1,s2,s3,mo,page,gr,m,cav);
}
}
else
printf("\nOK");
printf("\nDo You Want to See the Records of Particular Students ?(Y/N)");
ch=getch();
if(ch=='y' || ch=='Y')
{
clrscr();
printf("How Many RECORDS You want to See ?");
scanf("%d",&t);
for(j=1;j<=t;j++)
{
printf("\nEnter Class No. of the Student Whose Record You Want to Fetch:");
scanf("%d",&e);
fetch(cn,s1,s2,s3,mo,page,gr,e,m);
}
}
else
printf("\nOK");
getch();
}
0 comments: