both the players have to write any one of the following positions turn by turn according to their respective positions. For Example if player 'X' puts mark on (0 0), than player 'O' puts mark on (2 2). The position of two players cannot be same.

When the game ends the command prompt will automatically tells you that either player 'X' is the winner or player 'O' is the winner, or the game is TIE.