title: Correct usage of modulo operator's in C++
body: <p>I am trying to teach myself c++.</p>
  <p>On Sololearn I have a <a href="https://www.sololearn.com/learning/eom-project/1051/902" rel="nofollow noreferrer">task</a>, which is</p>
  <blockquote>
  <p>You are making a program for a bus service.
  A bus can transport 50 passengers at once.
  Given the number of passengers waiting in the bus station as input, you need to calculate and output how many empty seats the last bus will have.</p>
  <p>Sample Input: 126</p>
  <p>Sample Output: 24</p>
  </blockquote>
  <p>It also says I should use the &quot;%&quot; operator.
  This is the code I created:</p>
  <pre><code>    int bus = 50;
      int stop;
      cin &gt;&gt; stop;
      cout&lt;&lt; stop % bus;
      return 0;
  </code></pre>
  <p>I get 12.</p>
  <p>What is the correct way? I'm finding it difficult to understand what the modulo operator does. My understanding is that it divides as many times as it can and leaves the remainder (i.e. 16 % 3 = 1).</p>