We know that total number of three-digit number will be 900,
Now let n(A) be number of three-digit number which are divisible by 2, i.e,
A=100,102,...,998
⇒n(A)=450
n(B) be number of three-digit number which are divisible by 3, i.e, B=102,105,...,999
n(B)=300
Numbers divisible by both 2 and 3 is
102,108,...996 i.e, 150
Numbers divisible by both 2 and 7 are 112,126,...,994 i.e., 64 numbers.
Numbers divisible by both 3 and 7 is 105,126,...987 i.e, 43 numbers.
Numbers divisible by 2,3&7 is 126,168,...,966 i.e, 21 numbers.
Required number
=450+150−64−43+21=514
Hence, 514 three-digit number are there which are divisible by 2or3but not divisible by7.