Zebra0.com

cppDisplay "pass" or "fail" for each grade

Display "pass" or "fail" for each grade

This program loops to show "pass" or "fail" for each grade.

Notice that the first value is read before the loop and each subsequent value is read as the last thing in the loop. This avoids the problem of the negative value showing "Fail".