Surya Software interview question

Puzzle questions were bit tricky