Default value outside the loop

One solution to this problem employed in most programming languages is to
set a default value to the even variable before we enter the loop.
That way if we pass all the values without finding a match, the variable even
already has a value:

Comments

Author: Gabor Szabo

Gabor who runs the Code Maven site helps companies set up test automation, CI/CD
Continuous Integration and Continuous Deployment and other DevOps related
systems. Gabor can help your team improve the development speed and reduce the risk of bugs.