Zebra0.com

cppEnding a total loop with a sentinel value

Ending a total loop with a sentinel value

This program finds the total of numbers that are 0 or more. This program would work for scores on a test for instance, where a negative value is not in the valid data. Entering a value less than 0 ends the loop. This value that ends the loop is called a sentinel value.