title: How to write a binary algorithm for C/C++
body: <p>I am having trouble to write the binary algorithm in C/C++.<br>
  My question is like that:  </p>
  
  <p>Apply binary algorithm to search for a number from 1 to 100 in a number guessing game.<br>
  The user will respond with 'y' for a correct guess, 'h' if the guess is too high or 'l' if the guess is too low.</p>
  
  <p>I don't have any idea to apply it. Can someone just give me an example of the code.</p>