C programming

Saturday, January 17, 2009

#include #include void main() { struct { char name[20]; int id; int bm; int em; int total; }student[10]; clrscr(); int n,i,j; char *names; printf("Enter the student number:"); scanf("%d",&n); for(i=0;i { // printf("Name of the student[%d]=",i+1); // fflush(stdin); // gets(student[i].name); //scanf("%s",student[i].name); printf("\nId of the student[%d]=",i+1); scanf("%d",&student[i].id); printf("\nMark of bengoli[%d]=",i+1); scanf("%d",&student[i].bm); printf("\nMark of english[%d]=",i+1); scanf("%d",&student[i].em); student[i].total=student[i].bm+student[i].em; printf("\n\n"); } // printf("%s",student[0].name); printf("The information of the students are=\n\n"); printf(" Roll Bmark Emark TOTAL \n"); for(i=0;i { // printf("%10s",student[i].name); printf(" %6d",student[i].id); printf(" %6d",student[i].bm); printf(" %6d",student[i].em); printf(" %6d",student[i].total); printf("\n"); } for(i=0;i { for(j=i+1;j { if(student[i].total { // names=student[i].name; int tem1=student[i].total; int tem2=student[i].em; int tem3=student[i].bm; int tem4=student[i].id; student[i].total=student[j].total; student[i].em=student[j].em; student[i].bm=student[j].bm; student[i].id=student[j].id; student[j].total=tem1; student[j].em=tem2; student[j].bm=tem3; student[j].id=tem4; // student[j].name=names; } } } printf("The Merit list of student:\n\n"); printf(" Roll Bmark Emark TOTAL \n"); for(i=0;i { // printf("%s",student[i].name); printf(" %6d",student[i].id); printf(" %6d",student[i].bm); printf(" %6d",student[i].em); printf(" %6d",student[i].total); printf("\n"); } getch(); }

0 comments:

Visitors

PlugIn.ws - Free Hit Counter, Web Site Statistics, Traffic Analysis

  © Blogger template Leaving by Ourblogtemplates.com 2008

Back to TOP