First thing that I was told in College: All programs have bugs.
You just do the best that you can to find them, and hope that those you miss aren’t catastrophic.

I started when speed was important.

I would have found the first even number, calculated the number of even numbers in the range, and then added 2 to the starting number in the loop.

It would eliminate the IF statement and the loop would be half as long.

My first app out of college ran for 18 years without a single update. It solved 40 equations with 90 unknowns.

Good article for beginners.

William “Bill” Myers, Analyzes all, Programmer, retired. If you learn anything new, find enjoyment, have a new thought, then I’m successful. Photo: 1st article

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store