Thank you for the reply.

1. There is no task. I am just beginner, and trying to learn through book exercise problems.

2. As you might have understood from the comments in code, I a trying to get maximum possible moves for a knight without visiting its previous locations on a chess board. Now the glitch part, on running the code , it's count of maximum moves goes beyond 64, which shouldn't happen (max non repetitive moves on a chess board).