Surya Software Interview Question

Puzzle questions were bit tricky