Saturday, 10 December 2011

Write a program to input marks and find out percentage in c

#include
#include
main()
{
int m1,m2,m3,m4,m5;
long int tot;
float per;
clrscr();
printf("Enter the marks of a student in five subjects:-");
scanf("\n\n %d%d%d%d%d",&m1,&m2,&m3,&m4,&m5);
tot=m1+m2+m3+m4+m5;
per=(tot*100)/500;
printf("\n percentage of the student:-%f",per);
getch();
}


OUTPUT
Enter the marks of a student is subjects:-45 45 45 45 45
Percentage of the student:- 45.00

No comments:

Post a Comment