C program for calculating percentage
Calculate the total of marks and percentage
#include<stdio.h>
#include<conio.h>
void main()
{
float m,s,e,h,tot,per;
int max=400;
printf(“Enter the marks of Maths,Science,English,Hindi \n”);
scanf(“%f%f%f%f”,&m,&s,&e,&h);
tot=m+s+e+h;
per=tot/max*100;
printf(“Total=%f”,tot);
printf(“Percentage=%f”,per);
getch();
}
Comments
Post a Comment