How can I write an if statement with multiple conditions using && and ||? : <p>I am making a tic tac toe board game and I need the user to enter any position between 1 to 9 then type in X or O. Some conditions I need include is that I want to restrict the user to enter any number greater than 9 and do not enter any character either than 'X' or 'O'. The problem I encounter is that it doesn't follow the conditional statement. Any help would be appreciated.</p>

<pre><code>void CreateBoard(int m, int n, char board[][n])
{
    int i, j, position;
    char one;
    char two; 
    char temp;
    char xORo;
    int count = 0;
    int end;

    do {
        printf("Enter the number of the cell you want to insert X or O or enter -1 to exit: \n");
        scanf("%d", &amp;position);

        printf("Type X or O: \n");
        scanf(" %c", &amp;xORo);

        if(position &lt; 0){
            break;
        }
        if((position &gt; 9) &amp;&amp; xORo != ('X') &amp;&amp; ('O'))
        {
            continue;
        }   
        else if((position &gt; 0 || position &lt; 9) &amp;&amp; xORo == ('X') &amp;&amp; ('O'))
        {
            switch(position)
            {
                case 1: temp = xORo;
                        xORo = board[0][0];
                        board[0][0] = temp; 
                        break;
                case 2: temp = xORo;
                        xORo = board[0][1];
                        board[0][1] = temp; 
                        break;
                case 3: temp = xORo;
                        xORo = board[0][2];
                        board[0][2] = temp; 
                        break;
                case 4: temp = xORo;
                        xORo = board[1][0];
                        board[1][0] = temp; 
                        break;
                case 5: temp = xORo;
                        xORo = board[1][1];
                        board[1][1] = temp; 
                        break;
                case 6: temp = xORo;
                        xORo = board[1][2];
                        board[1][2] = temp; 
                        break;
                case 7: temp = xORo;
                        xORo = board[2][0];
                        board[2][0] = temp; 
                        break;
                case 8: temp = xORo;
                        xORo = board[2][1];
                        board[2][1] = temp; 
                        break;
                case 9: temp = xORo;
                        xORo = board[2][2];
                        board[2][2] = temp; 
                        break;
            }
            PrintBoard(3, 3, board);
        }

    }while(position != -1);
}
</code></pre>
