You didn't actually post your code, so I can't really tell you why it's not working. The general idea for running a process until the user quits is something like:
Code:
do {
    // play the game
    print "Play again [y|n]?"
    play_again = getchar();
    // flush the input buffer -- read about it here
} while (play_again == 'y' || play_again == 'Y');
That red text in there is a link, so click it and read up.

A few common mistakes we see around here are for this type of problem:
1. failing to flush the input buffer -- getchar wont remove the character that represents the user hitting the enter key
2. Not realizing that lower case 'y' and upper case 'Y' are two separate characters according to C
3. Incorect use of the || or && operator: play_again == 'y' || 'Y' is wrong.
4. Getting confused on which combination of ==, !=, || and && to use.