Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
This is impossible, the man is free to enter anything into the console.
But your task as a programmer is to somehow prevent incorrect input. Whether to display an error, or independently round, or require re-entry ... You yourself think what is required from your program.
The condition "ends in 5" is equivalent to "not divisible by 10, but divisible by 5".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question