Every natural number N can be uniquely factorised into its prime factors:

If a number is a perfect square each of the prime factors must be raised to even powers
If a number is a perfect cube, each of the prine factors must be raised to powers that are multiples of 3.
Thus if a number is a perfect square and a perfect cube, each factors is raised to a power that is a multiple of 6 i.e. if N is such a number N = a6 where a is a natural number.
Since our upper bound is 106, there are only 10 such numbers in the given range
for part (a) the number of perfect cubes is 100 of these only 10 are also perfect squares. Hence prob = 0.1
for part(b) the number of perfect squares is 1000 and so the prob = 0.01.