It's working perfectly now, I just added another part into the program it's working fine too. Tell me what you think.
Oh btw should the part in bold be after the validation loop or before?
Code:
do {
total = 0;
loop++;
printf("Enter the Student's ID: ");
scanf("%d", &studID);
for (m = 1; m < 6; m++)
{
printf("Enter Mark #%d: ", m);
scanf("%f", &mark);
while (mark > 20 || mark < 0)
{
printf("Invalid grade entered. Must be 0.0 to 20.0, please re-enter: ");
scanf("%f", &mark);
}
store = store + mark;
total = total + mark;
average = (store / (loop * 100)) * 100;
}
printf("%d's total mark is: %.2f\n", studID, total);
printf("Enter the Student's ID ['0' to quit]: ");
scanf("%d", &studID);
} while (studID != 0);
printf("Enter the Section Code ['0' to quit]: ");
scanf("%d", &sCode);
} while (sCode != 0);
printf("The average for the section is: %.2f%\n", average);
}