The error is present in part (C). 'To +Gerund' is used with certain verbs and phrases like 'with a view to, to be used to, etc.'. So, 'study' will be replaced with 'studying'.
Hence, option (c) is correct.
The correct sentence is: When I asked him Rahul told me that he came here with a view to studying but he felt really distracted.
NOTE:
Gerund: Gerund is a verb form that functions as a noun, ending in -ing. A gerund can be either the subject or object of a sentence in English. Example: "Everybody enjoyed her dancing and singing at the party." The words 'dancing' and 'singing' are gerunds.