# Percentage of Mark

the program below indicates the calculation of percentage.The user is asked to enter the marks of three subjects and then the percentage of total mark is calculated.

Average mark is also calculated by dividing total mark by 3.
``````#include<stdio.h>
#include<conio.h>

void main ()
{
float m1,m2,m3;
float per;
float total;
//clrscr();
printf(" enter the marks of m1: ");
scanf("%f", &m1);
printf(" enter the marks of m2: ");
scanf("%f", &m2);
printf("enter the marks of m3: ");
scanf("%f", &m3);
total= m1+m2+m3;
printf("the total mark is:  %.2f",total);
per = (total/300)*100;
avg = (total/3);
printf(" the percentage mark is: %.2f", per);
printf("\n the average mark  is: %.2f", avg);
getch();
}``````

Based on the percentage of the student in three subjects , calculate the grade using this range.

39 or less Fail
``````#include<stdio.h>
#include<conio.h>

void main ()
{
float m1,m2,m3;
float per,avg;
float total;

printf(" enter the marks of m1 ");
scanf("%f", &m1);
printf(" enter the marks of m2 ");
scanf("%f", &m2);
printf("enter the marks of m3 ");
scanf("%f", &m3);
total= m1+m2+m3;
printf("\n the total mark is %.2f ",total);
per = (total/300)*100;
avg = (total/3);
printf("\n the percentage mark is : %.2f ", per);
printf("\n the average mark  is: %.2f", avg);

else if(per>=60) printf("\n Grade : B");
else if(per>=40) printf("\n Grade : C");
else if(per<40) printf("\n Fail ");

getch();
}``````

## Subscribe

* indicates required
Subscribe to plus2net plus2net.com

 Tahir khan 09-11-2018 i am a student. i want to become a software engineer this website is so helpful for me