I've coded a console blackjack game for fun a few months back, you can get the source here:
http://70.86.55.186/~guyonasm/coding/blackjack.tar.gz
Simply use WinRAR to extract it.
As for your question, You could keep track of the total hand value of the computer in lets say cValueCount. And we also kept the players hand value in pValueCount. Then you'd run a conditional statement on it as such:
Code:
while (valueCount < 16 && pValueCount <= 21)
{
// keep picking cards
}
Its a slight adaption to my code, but basically if the player's hand is already over 21, then there's no need to get anymore cards, because we've already won regardless. But if we're below the value of 16, we're going to pluck again.