It doesn't look like you have coded any type of AI at all. in terms of how to make it the computers turn and draw the board, using your design of a loop, something like this:
turn=0;
while(gameover==0)
{
turn++;
if(turn%2==1) // users turn
{
hi input move
check for legality and if they won
draw board ( can be as simple as printing in the console)
}
else
{
run computer AI
Make move chosen
drawboard
}
} // while end loop
In terms of your AI, i recommend exploring two concepts, recursion and min max. recursion means you have a function make all possible moves at that level of turn and for each move it calls teh same function that makes the moves search() from that function. It terminates calling the function when their are no more moves to make and then scores and returns the score. 1=win 0=draw -1=loss. each ply of search wants to return the best move relative to the side its playing, so if your on ply 3 ( the computers second move ) and one of your moves scores a 1 ( a win) you return that. if the best you get out of your moves is a 0 you return that, and if all you got is -1 you return that. this is called min max.
Mike