Accept the marks in physics for 40 students in a class. Calculate & print the number of students in the given ranges of marks using do - while loop. < = 40, 41 to 70, 71 to 100 c++ help plz
Answers
Answer:
Find out the Percentage of mark and average mark in three subjects.
Based on the percentage of the student in three subjects , calculate the grade using this range.
80 or above A grade
60 or above B grade
40 or above C grade
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); ///// Grade calculation // if(per>=80) printf("\n Grade : A"); else if(per>=60) printf("\n Grade : B"); else if(per>=40) printf("\n Grade : C"); else if(per<40) printf("\n Fail "); getch(); }Allow user to enter numbers & exit if user enters 0 or negative number