#include "stdio.h"
#include "conio.h"
void main()
{
char n[5];
int m1[5],m2[5],m3[5],tot[5],i,g=0,pos;
clrscr();
for(i=0;i<5;i++)
{
printf("Enter name and marks of 3 subjects");
scanf("%c %d %d %d",&n[i],&m1[i],&m2[i],&m3[i]);
fflush(stdin);
tot[i]=m1[i]+m2[i]+m3[i];
if(tot[i]>g)
{
g=tot[i];
pos=i+1;
}
}
clrscr();
printf("\n \t\t\tMarksheet");
printf("\n \t\t\t---------");
printf("\n\n----------------------------------------------");
printf("\nName\tMaths\tPhy\tChem\tTotal");
printf("\n------------------------------------------------");
for(i=0;i<5;i++)
{
printf("\n%c\t %d\t %d\t %d\t %d\n",n[i],m1[i],m2[i],m3[i],tot[i]);
}
printf("\n------------------------------------------------");
printf("\nThe Highest Total=%d",g);
printf("\nThe Number of the Candidate=%d",pos);
getch();
}
#include "conio.h"
void main()
{
char n[5];
int m1[5],m2[5],m3[5],tot[5],i,g=0,pos;
clrscr();
for(i=0;i<5;i++)
{
printf("Enter name and marks of 3 subjects");
scanf("%c %d %d %d",&n[i],&m1[i],&m2[i],&m3[i]);
fflush(stdin);
tot[i]=m1[i]+m2[i]+m3[i];
if(tot[i]>g)
{
g=tot[i];
pos=i+1;
}
}
clrscr();
printf("\n \t\t\tMarksheet");
printf("\n \t\t\t---------");
printf("\n\n----------------------------------------------");
printf("\nName\tMaths\tPhy\tChem\tTotal");
printf("\n------------------------------------------------");
for(i=0;i<5;i++)
{
printf("\n%c\t %d\t %d\t %d\t %d\n",n[i],m1[i],m2[i],m3[i],tot[i]);
}
printf("\n------------------------------------------------");
printf("\nThe Highest Total=%d",g);
printf("\nThe Number of the Candidate=%d",pos);
getch();
}
No comments:
Post a Comment