Simulate Tic Tac Toe game using C language
void main() is not portable

Although it "works" in a lot of cases, the only two portable definitions of main are:

int main(void)


and

int main(int argc, char **argv)


Error checking

You don't check the return value of scanf.

This would be better:

if(scanf("%d", &amp;n) != 1)
{
    fputs("Error; enter a number.", stderr);
    return EXIT_FAILURE; /* entering a letter will cause infinite loop so error out here */
}


Note that EXIT_FAILURE requires stdlib.h to be included.

Out-of-bounds write

If a user enters a 0 or a number greater than 9 in the scanf mentioned above, this line will write outside of the array bounds:

    TOT[n-1]=a;


This can cause a segmentation fault.

Spelling

There are a couple spelling errors in this code:


  cheak -> check
  tern -> turn


Formatting

There are a few issues with formatting here; first of all, each line in a function should be indented by at least 4 spaces. In addition, you should put spaces after commas  in function calls, and around most (if not all) operators.

Portability

Although clrscr and getch work with Windows and DOS, I would suggest simply removing clrscr and replacing getch with getchar. This makes your code portable to the point where it can run on most other systems.

Non-descriptive variable names

At first glance, I don't know what t, T, TOT, a, i, n, r, or p are for. The variable names should describe what they contain.

Spacing

Although the board is nice, the prompt to the user isn't. I would suggest something like this:

    printf("\n\n\nPlayer 1 = X\nPlayer 2 = O");
    printf("\nPlayer %d's turn.",p);
    printf("\n\nEnter a number: ");


...

    if(r == 1 || r == 2)
    {
        board(TOT);
        printf("\nPlayer %d wins!", r);
        break;
    }


Misc.

p is already 1 here. You don't need to set it again:

    else
        {
        p=1;
        }