Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 5 Problem 13 (c) #6

Open
Grimleik opened this issue Oct 8, 2018 · 0 comments
Open

Chapter 5 Problem 13 (c) #6

Grimleik opened this issue Oct 8, 2018 · 0 comments

Comments

@Grimleik
Copy link

Grimleik commented Oct 8, 2018

https://github.com/jaege/Cpp-Primer-5th-Exercises/blob/master/ch5/5.13.md

The solution is fine, but there is a logical mistake in the code we were provided.

The minor issue here is that the case 10 will never be hit if we modulus with 10.
If we want the switch to count all even numbers we should make a case label for 0 not 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant