After looking at your checkWin function you can change it from
if((B[0][0] == B[0][1] && B[0][1] == B[0][2]))
{
if (B[0][0]=='x')
win=1;
else if (B[0][0]=='o')
win=2;
if (B[0][1]=='x')
win=1;
else if (B[0][1]=='o')
win=2;
if (B[0][2]=='x')
win=1;
else if (B[0][2]=='o')
win=2;
}
to this
if( B[0][0] == B[0][1] && B[0][1] == B[0][2] )
{
if ( B[0][0] == 'x' )
win = 1;
else if ( B[0][0] == 'o' )
win = 2;
}
for each of them because you already know that B[0][x] where x is 0 1 2 are all the same.
Also I would use else if for each row/col/diag check because a win is a win and you do not need to check to see if you won in 2 different ways so there is no point in checking more than one way if you do not have to.