I have posted my code below which is in fact giving the same output as expected. Please help me with this problem as I am constantly experiencing this type of problems in ot