/ Undifined / 10 - WAP that accepts marks of five subjects and finds percentage and prints grades according to the

10 - WAP that accepts marks of five subjects and finds percentage and prints grades according to the

WAP that accepts marks of five subjects and finds percentage and prints grades according to the


WAP that accepts marks of five subjects and finds percentage and prints grades according to the 
following criteria: 
Between 90-100%--------------Print ‘A’ 
80-90%----------------------------Print ‘B’ 
60-80%---------------------------Print ‘C’ 
Below 60%----------------------Print ‘D’ 
#include<stdio.h>
 
#include<conio.h>
 
void main()
 
{
 
float m1,m2,m3,m4,m5,percent;
 
clrscr();
 
printf("Enter the marks of the student in 5 subjects:\n");
 
scanf("%f%f%f%f%f",&m1,&m2,&m3,&m4,&m5);
 
percent=(m1+m2+m3+m4+m5)/5;
 
printf("\nPercentage=%f",percent);
 
if(percent>90.0 && percent<=100.0)
 
printf("\nGrade:A");
 
else if(percent>80.0 && percent<=90.0)
 
printf("\nGrade:B");
 
else if(percent>60.0 && percent<=80.0)
 
printf("\nGrade:C");
 
else
 
printf("\nGrade:D");
 
getch();
 
}
Output 
Enter the marks of the student in 5 subjects:
 
80
 
92
 
94
 
84
 
78
 
 
 
Percentage=85.599998
 
Grade:B

about author

Blogger Sens it website about blogger templates and blogger widgets you can find us on social media
Previous Post :Go to tne previous Post
Next Post:Go to tne Next Post

No comments:

Post a Comment