Read input file until certain line c++ : <p>I'm new to programming, so I was wondering...</p>

<p>If I have an input file consisting of 100 lines, how do I read only up to line 50 and print out each line?</p>

<p>Thanks.</p>
