base on the flow chart.
write a coding.
Here is the example which implementing while loop.
#include <stdio.h>
main()
{
int a =1;
float total = 0;
int total_A = 0;
int total_B = 0;
int total_C = 0;
int total_D = 0;
int total_F = 0;
float marks;
while (a<19) // be aware that in the flow chart i just use 11 for 10 value, in the test data it give 18
values.
{
printf("\nInsert the %d's student's marks = ", a);
scanf("%f", &marks);
if (marks>100) {
printf("Invalid marks value(must be less than 100)");
} else if (marks>=90) {
//printf("Grade is: A");
total_A+=1;
} else if (marks>=70) {
//printf("Grade is: B");
total_B+=1;
} else if (marks>=50) {
//printf("Grade is: C");
total_C+=1;
} else if (marks>=35) {
//printf("Grade is: D");
total_D+=1;
} else if (marks>=0) {
//printf("Grade is: F");
total_F+=1;
} else {
printf("Invalid score");
}
a++;
}
printf("A's scorer = %d\n",total_A);
printf("B's scorer = %d\n",total_B);
printf("C's scorer= %d\n",total_C);
printf("D's scorer= %d\n",total_D);
printf("D's scorer= %d\n",total_F)
}