Consider the same sequence of three instructions and the same initial state mentioned above. Three more instructions are added at the end of the above sequence to have A contain 4 litres of water. In this total sequence of six instructions, the fourth one is DRAIN (A). This is the only DRAIN instruction in the entire sequence. At the end of the execution of the above sequence, how much water (in litres) is contained in C?
Explanation:
After third instruction A has 1 litre, B has 2 litres and C has 2 litres of water.
Instruction 4: DRAIN A
Instruction 5: EMPTY (B, A)
Instruction 6: EMPTY (C, A)
After 6th instruction, C has no water as all 2 litres have been transferred to A.
Hence, option (c).
Help us build a Free and Comprehensive Preparation portal for various competitive exams by providing us your valuable feedback about Apti4All and how it can be improved.