by setting the condition in this way (check < 75) && (check >= 8); we exclude the 75 so my question is why we don’t also exclude the 8
Hi @Djamal_Abdounassir_H !!
The reason we include 8 in the solution is because the task explicitly states that we need to check if the number lies between 8 and 75, inclusive of 8 only. Inclusive means that the range includes all numbers between 8 and 75, and also 8.
So when we set the condition as (check < 75) && (check >= 8)
, it ensures that the variable check
is less than 75 (excludes 75) and greater than or equal to 8 (includes 8), which satisfies the requirement of checking if the number lies between 8 and 75 inclusive of 8.
If we were asked to exclude 8 from the range, the condition would have been different, such as (check < 75) && (check > 8)
. But since the task specifies inclusivity of 8, we need to include it in our solution.
I hope it helps. Happy Learning