You are on page 1of 2

#include<stdio.

h>
#include<conio.h>
char subject[5][10]={
"Physics",
"Chemistry",
"Biology",
"English",
"Gujarati"
};
void main()
{
char student[30][20],ans;
int i,j,snum,sbnum,marks[30][5];
float per[30],subavg[5],total;
clrscr();
for(i=0;i<5;i++)
{
printf("\nStudents %d\n",i+1);
fflush(stdin);
for(j=0;j<5;j++)
{
marks[i][j]=0;
printf("Enter the marks for %s:",subject[j]);
scanf("%d",&marks[i][j]);
if(marks[i][j]>100)
{
exit();
}
total=total+marks[i][j];
per[i]=total/5;
}
printf("The Total Marks are: %f\nThe Percentage scored is:%f\n",total,per[i]);
if(per[i]>70)
{
printf("Grade A+\n");
}
else if(per[i]>=65 && per[i]<70)
{
printf("Garde A\n");
}
else if(per[i]>=50 && per[i]<65)
{
printf("Grade B\n");
}
else
{
printf("You are Fail\nBetter luck next time\n");
}
total=0;
per[i]=0;
}
/*
for(i=0;i<5;i++)
printf("%s\t", subject[i]);
for(i=0;i<3;i++)
{
if(per[i]>80)
{
printf("\n%s",student[i]);
for(j=0;j<5;j++)
printf("\t%d",marks[i][j]);
}

}*/

getch();
}

You might also like