The explanation can[1] be given by analysing their respective resonance[2] structures which is as follows:
(Credits: ChemWriter)
Now,
inductive effects would work.
In case of first (c's resonance), positive charge would be stabilised by $\ce{+I}$ effect of methyl group; whereas in the second (d's resonance) one, $\ce{+I}$ effect would become dead upto the positive charge.
Hence, less stable would be (d).
Notes:
[1]: Firstly, I'm not sure if hyperconjugation will stabilize carbocation in resonance structures or not, because it will separate the charges even more. Secondly, in the given structures, it is very hard to differentiate the stability, as contribution of inductive and hyperconjugation are resulting in comparable stabilities. Hence, I tried it explaining by other canonical form.
[2]: resonance will happen due to conjugation of $\ce{\pi}$ bonds in both of the molecules