rand() will generate a random number between 0 and a predefined constant. You need a number between 1 and 8, so you'll need to do some math. Specifically, reduce the random number mod 8 and shift up by one. More specifically,
int computer_move = rand() % 8 + 1;
This will generate the random number. You will need to generate a new number every time the computer wants to make a move.
The seed (srand()) only needs to happen once, at the beginning of your program. That is, you should put this function call at the top of main.