title: How to debug a program without a debugger?
body: <p>Interview question-</p>
  
  <p>Often its pretty easier to debug a program once you have trouble with your code.You can put watches,breakpoints and etc.Life is much easier because of debugger.</p>
  
  <blockquote>
    <p><strong>But how to debug a program without a debugger?</strong></p>
    
    <p>One possible approach which I know is simply putting print statements in your code wherever you want to check for the problems.</p>
  </blockquote>
  
  <p>Are there any other approaches other than this? </p>
  
  <p>As its a general question, its not restricted to any specific language.So please share your thoughts on how you would have done it? </p>
  
  <blockquote>
    <p><strong>EDIT</strong>- While submitting your answer, please mention a useful resource (if you have any) about any concept. e.g. Logging<br>
    This will be lot helpful for those who don't know about it at all.(This includes me, in some cases :)</p>
    
    <p><strong>UPDATE:</strong> Michal Sznajderhas put a real "best" answer and also made it a community wiki.Really deserves lots of up votes.</p>
  </blockquote>