Pyridine is stronger base than aniline,
The stornger base is that compound which can easily give away lone pair of electrons.
In case of pyridine, lone pair of electrons on nitrogen atom in the pyridine ring is not participating in resonance,
While lone pair of electrons on nitrogen atom in aniline are participating in resonance by forming pi bonds between nitrogen and ring carbon to which the nitrogen atom is directly attached in aniline.
Therefore, pyridine is more basic than aniline.
But 4-methyl piperidine is even stronger base than pyridine.
An increase in s character on an atom increases the electronegativity of that atom which favors acidity and therefore disfavors basicity.
Nitrogen in piperidine is sp3 hybridised while in pyridine it is sp2 hybridised.
Hence sp3-hybridized nitrogen is more basic than either sp2 or sp hybridized nitrogen as sp2 centres are electron withdrawing centres while sp3 centres are electron donating centres.
In addition to sp3 centre, there is electron donating methyl substituent present in piperidine.
Hence, 4-methyl piperidine is more basic due to easy electron donating nitrogen atom.
In the fourth compound that is piperidin-2-one, there is electron withdrawing carbonyl group present on carbon atom next to nitrogen. That form conjugation of pi bnond electrons and lone pair of electrons.
Thus, electron pair is not easily available for donation hence, less basicity.
Thus, the most basic compound among given options is 4-methyl piperidine.
Correct option is "c".