Answer:
1/4
Explanation:
There are 40/8 = 5 integers in the range that are divisible by 8. There are floor(40/6) = 6 integers in the range that are divisible by 6. Of those sets of integers, one (24) is divisble by both numbers. So, altogether, there are 5+6-1 = 10 of the 40 integers that are divisible by 6 or 8.
If you choose an integer at random from the range 1–40, the probability is 10/40 = 1/4 that it will be divisible by 6 or 8.