To keep checking if more pairs need to be found you would use a while loop. Something on lines of while (matches != 8) keep finding pairs.
Inide the while loop you should have some function calls, one to display the board, one to read the user inputs, one to check if there is a match etc.
The board itself should probably be made using 4x6 matrix with containing the asterics, but have another matrix containing numbers. The function call to read the inputs should replace the asteric with the number in the location you entered.
This might not be the best way to go about this but its how I did a similar program in my C++ class last semester. Make sure to use functions to help organize your program so you can test it piece by piece rather than doing it all at once and having a ton of errors to go through!
You should make a function called checkforwin(), which loops through the array checking if the number entered appears twice. If it does, the function returns true, else false. This return value should be caught in the loop in main, and the loop should terminate when the return value is true.