The condition, num < min && num > max
does not make sense as num
can not be less than min
and greater than max
at the same time. It should be:
num < min || num > max
which means num
is either less than min
or greater than max
.
CLICK HERE to find out more related problems solutions.