user57712: #include <iostream>
using namespace std;
char board[3][3]={{'1','2','3'},{'4','5','6'},{'7','8','9'}};
char turn='X';
int draw=0;
int row,column;
void display_board()
{
    system("cls");
    cout<<"\n\n TIC TAC TOE GAME:";
    cout<<"\n\n PLAYER[1]==O\t\t\t PLAYER[2]==X";
    cout<<"\t\t     |     |     \n";
    cout<<"\t\t     |     |     \n";
    cout<<"\t\t   "<<board[0][0]<<" |  "<<board[0][1]<<"  |  "<<board[0][2]<<"   \n";
    cout<<"\t\t     |     |     \n";
    cout<<"\t\t_____|_____|_____\n";
    cout<<"\t\t     |     |     \n";
    cout<<"\t\t     |     |     \n";
    cout<<"\t\t  "<<board[1][0]<<"  |  "<<board[1][1]<<"  |  "<<board[1][2]<<"    \n";
    cout<<"\t\t     |     |     \n";
    cout<<"\t\t_____|_____|_____\n";
    cout<<"\t\t     |     |     \n";
    cout<<"\t\t     |     |     \n";
    cout<<"\t\t  "<<board[2][0]<<"  |  "<<board[2][1]<<"  |   "<<board[2][2]<<"  \n";
    cout<<"\t\t     |     |     \n";
    cout<<"\t\t     |     |     \n";
}
void player_turn()
{
    int choice;
    if(turn=='X')
    {
        cout<<"\n\t  PLAYER[1]==O's turn";
    }
    if(turn=='O')
    {
        cout<<"\n\t  PLAYER[2]==X's turn";
    }
    cin>>choice;
    switch(choice)
    {
        case 1:row=0; column=0; break;
        case 2:row=0; column=1; break;
        case 3:row=0; column=2; break;
        case 4:row=1; column=0; break;
        case 5:row=1; column=1; break;
        case 6:row=1; column=2; break;
        case 7:row=2; column=0; break;
        case 8:row=2; column=1; break;
        case 9:row=2; column=2; break;
        default:
        cout<<"Invalid input";
        break;
    }
   if(turn=='X' && board[row][column]!='X' && board[row][column]!='O')
   { 
       board[row][column]=='X';
       turn='O';
   }
   else if(turn=='O' && board[row][column]!='X' && board[row][column]!='O')
   { 
       board[row][column]=='O';
       turn='X';
   }
   else
   {
       cout<<"Box already filled!\nplease try again!!";
       player_turn();
   }
   display_board();
}
int gameover()
{
    for(int i=0;i<3;i++)
    {
        if(board[i][0]==board[i][1] && board[i][0]==board[i][2] || board[0][i]==board[1][i] && board[0][i]==board[2][i])
        return 0;
        else if(board[0][0]==board[1][1] && board[0][0]==board[2][2] || board[0][0]==board[1][1] && board[0][0]==board[2][2])
        return 0;
    }
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<3;j++)
        {
            if(board[i][j]!='X' && board[i][j]!='O')
            return 1;
        }
    }
    draw=1;

    return 0;
}


int main()
{
    system("cls");
    while(gameover())
    {
    display_board();
    player_turn();
    gameover();
    }
    return 0;
}


if(turn=='X' && draw=0)
{
    cout<<"PLAYER[2] WINS!!!";
}
else if(turn=='O' && draw==0)
{
    cout<<"PLAYER[1] WINS!!!";
}
else
{
    cout<<"GAMEDRAW!!!";
}


user31105: This fragment is outside of a function:
if(turn=='X' && draw=0)
{
    cout<<"PLAYER[2] WINS!!!";
}
else if(turn=='O' && draw==0)
{
    cout<<"PLAYER[1] WINS!!!";
}
else
{
    cout<<"GAMEDRAW!!!";
}

Some other remarks:

Instead of multiple return statements, it is better to create a local variable, set it, and return that one at the end. So only use one return statement per function (that has a return value).
As chrisl mentions: Arduino does not have cin or cout. Use the Serial class for this.
You can replace the following code:




 switch(choice)
 {
    case 1:row=0; column=0; break;
    case 2:row=0; column=1; break;
    case 3:row=0; column=2; break;
    case 4:row=1; column=0; break;
    case 5:row=1; column=1; break;
    case 6:row=1; column=2; break;
    case 7:row=2; column=0; break;
    case 8:row=2; column=1; break;
    case 9:row=2; column=2; break;

by
row    = (int) ((choice - 1) / 3);
column =        (choice - 1) % 3;


Use an enum as return type for function gameover()
E.g. EGameState { Running, PlayerOneWon, PlayerTwoWon, Draw };
This removes also the global variable draw.
You call function gamover twice, one time within the while loop without checking the result.
Do not use a char for the variable turn but the player number, or a boolean (XPlayerHasTurn), or an enum.


57712: <pre><code>#include &lt;iostream&gt;
using namespace std;
char board[3][3]={{'1','2','3'},{'4','5','6'},{'7','8','9'}};
char turn='X';
int draw=0;
int row,column;
void display_board()
{
    system("cls");
    cout&lt;&lt;"\n\n TIC TAC TOE GAME:";
    cout&lt;&lt;"\n\n PLAYER[1]==O\t\t\t PLAYER[2]==X";
    cout&lt;&lt;"\t\t     |     |     \n";
    cout&lt;&lt;"\t\t     |     |     \n";
    cout&lt;&lt;"\t\t   "&lt;&lt;board[0][0]&lt;&lt;" |  "&lt;&lt;board[0][1]&lt;&lt;"  |  "&lt;&lt;board[0][2]&lt;&lt;"   \n";
    cout&lt;&lt;"\t\t     |     |     \n";
    cout&lt;&lt;"\t\t_____|_____|_____\n";
    cout&lt;&lt;"\t\t     |     |     \n";
    cout&lt;&lt;"\t\t     |     |     \n";
    cout&lt;&lt;"\t\t  "&lt;&lt;board[1][0]&lt;&lt;"  |  "&lt;&lt;board[1][1]&lt;&lt;"  |  "&lt;&lt;board[1][2]&lt;&lt;"    \n";
    cout&lt;&lt;"\t\t     |     |     \n";
    cout&lt;&lt;"\t\t_____|_____|_____\n";
    cout&lt;&lt;"\t\t     |     |     \n";
    cout&lt;&lt;"\t\t     |     |     \n";
    cout&lt;&lt;"\t\t  "&lt;&lt;board[2][0]&lt;&lt;"  |  "&lt;&lt;board[2][1]&lt;&lt;"  |   "&lt;&lt;board[2][2]&lt;&lt;"  \n";
    cout&lt;&lt;"\t\t     |     |     \n";
    cout&lt;&lt;"\t\t     |     |     \n";
}
void player_turn()
{
    int choice;
    if(turn=='X')
    {
        cout&lt;&lt;"\n\t  PLAYER[1]==O's turn";
    }
    if(turn=='O')
    {
        cout&lt;&lt;"\n\t  PLAYER[2]==X's turn";
    }
    cin&gt;&gt;choice;
    switch(choice)
    {
        case 1:row=0; column=0; break;
        case 2:row=0; column=1; break;
        case 3:row=0; column=2; break;
        case 4:row=1; column=0; break;
        case 5:row=1; column=1; break;
        case 6:row=1; column=2; break;
        case 7:row=2; column=0; break;
        case 8:row=2; column=1; break;
        case 9:row=2; column=2; break;
        default:
        cout&lt;&lt;"Invalid input";
        break;
    }
   if(turn=='X' &amp;&amp; board[row][column]!='X' &amp;&amp; board[row][column]!='O')
   { 
       board[row][column]=='X';
       turn='O';
   }
   else if(turn=='O' &amp;&amp; board[row][column]!='X' &amp;&amp; board[row][column]!='O')
   { 
       board[row][column]=='O';
       turn='X';
   }
   else
   {
       cout&lt;&lt;"Box already filled!\nplease try again!!";
       player_turn();
   }
   display_board();
}
int gameover()
{
    for(int i=0;i&lt;3;i++)
    {
        if(board[i][0]==board[i][1] &amp;&amp; board[i][0]==board[i][2] || board[0][i]==board[1][i] &amp;&amp; board[0][i]==board[2][i])
        return 0;
        else if(board[0][0]==board[1][1] &amp;&amp; board[0][0]==board[2][2] || board[0][0]==board[1][1] &amp;&amp; board[0][0]==board[2][2])
        return 0;
    }
    for(int i=0;i&lt;3;i++)
    {
        for(int j=0;j&lt;3;j++)
        {
            if(board[i][j]!='X' &amp;&amp; board[i][j]!='O')
            return 1;
        }
    }
    draw=1;

    return 0;
}


int main()
{
    system("cls");
    while(gameover())
    {
    display_board();
    player_turn();
    gameover();
    }
    return 0;
}


if(turn=='X' &amp;&amp; draw=0)
{
    cout&lt;&lt;"PLAYER[2] WINS!!!";
}
else if(turn=='O' &amp;&amp; draw==0)
{
    cout&lt;&lt;"PLAYER[1] WINS!!!";
}
else
{
    cout&lt;&lt;"GAMEDRAW!!!";
}
</code></pre>
 31105: <p>This fragment is outside of a function:</p>

<pre><code>if(turn=='X' &amp;&amp; draw=0)
{
    cout&lt;&lt;"PLAYER[2] WINS!!!";
}
else if(turn=='O' &amp;&amp; draw==0)
{
    cout&lt;&lt;"PLAYER[1] WINS!!!";
}
else
{
    cout&lt;&lt;"GAMEDRAW!!!";
}
</code></pre>

<p>Some other remarks:</p>

<ol>
<li><p>Instead of multiple <code>return</code> statements, it is better to create a local variable, set it, and return that one at the end. So only use one <code>return</code> statement per function (that has a return value).</p></li>
<li><p>As chrisl mentions: Arduino does not have cin or cout. Use the Serial class for this.</p></li>
<li><p>You can replace the following code:</p></li>
</ol>

<blockquote>
  <p></p>
</blockquote>

<pre><code> switch(choice)
 {
    case 1:row=0; column=0; break;
    case 2:row=0; column=1; break;
    case 3:row=0; column=2; break;
    case 4:row=1; column=0; break;
    case 5:row=1; column=1; break;
    case 6:row=1; column=2; break;
    case 7:row=2; column=0; break;
    case 8:row=2; column=1; break;
    case 9:row=2; column=2; break;
</code></pre>

<p>by</p>

<pre><code>row    = (int) ((choice - 1) / 3);
column =        (choice - 1) % 3;
</code></pre>

<ol start="4">
<li><p>Use an enum as return type for function <code>gameover()</code>
E.g. EGameState { Running, PlayerOneWon, PlayerTwoWon, Draw };</p>

<p>This removes also the global variable <code>draw</code>.</p></li>
<li><p>You call function <code>gamover</code> twice, one time within the while loop without checking the result.</p></li>
<li><p>Do not use a char for the variable <code>turn</code> but the player number, or a boolean (XPlayerHasTurn), or an enum.</p></li>
</ol>
