Step 1: Analyzing the context.
The sentence is about Hari Singh, who does not know how to cook but tells someone that he can cook. This implies that he is trying to explain why he would be able to cook in the future. Step 2: Identifying the correct choice.
- (A) he wanted work and food is incorrect because it does not explain why he would want to cook.
- (B) he wanted some place to sleep for a night is also incorrect because it is unrelated to the reason for cooking.
- (C) he wanted to train Anil as a cook is incorrect because the context does not mention training anyone else.
- (D) he wanted to learn cooking is correct because it explains that he is eager to learn the skill of cooking. Step 3: Conclusion.
Thus, the correct answer is (D) he wanted to learn cooking.