You are on page 1of 2

int main()

{
char student_name[20];
int maths;
int chemistry;
int physics;
int english;
int hindi;
int total;
const int total_marks=500;
float Average;
float percentage;
const int P=100;
printf("Let check out the results of students. \n");
printf("\n");
printf("Enter the name of the student. \n");
scanf("%s",&student_name);
printf("enter the marks of maths:- \n");
scanf("%d",&maths);
printf("enter the marks of chemistry:- \n");
scanf("%d",&chemistry);
printf("enter the marks of physics:- \n");
scanf("%d",&physics);
printf("enter the marks of english:- \n");
scanf("%d",&english);
printf("enter the marks of hindi:- \n");
scanf("%d",&hindi);
total = maths+chemistry+physics+english+hindi;
printf("the total number are %d out of 500",total);
printf("\n");
printf("\n");
printf("The total marks of all subject is:- %d \n",total_marks);
Average = (float)total/total_marks;
printf("\n");
printf("The Average of Marks is = %f",Average);
printf("\n");
printf("\n");
printf("the total number which you had gain out of 500 to get a percentage. \n");
printf("\n");
percentage = Average * P;

printf("The percentage of marks is:- %f \n",percentage);


printf("\n");
if(percentage<50){
printf("Fail");
}else{
printf("Pass");
}

return 0;
}

You might also like