Corrected the code.. made it working and now printing both the solutions.