title: How to calculate minimum number of operations to make a number divisible by another
body: <p>I have a coding prompt I am trying to solve:</p>
  <blockquote>
  <p>You are given two positive integers <code>a</code> and <code>b</code>. In one move you can increase <code>a</code> by 1 (replace <code>a</code> with <code>a+1</code>). Your task is to find the minimum number of moves you need to do in order to make <code>a</code> divisible by <code>b</code>. It is possible that you have to make 0 moves, as <code>a</code> is already divisible by <code>b</code>. You have to answer <code>t</code> independent test cases.</p>
  </blockquote>
  <blockquote>
  <p>Input:
  The first line of the input contains <code>t(1&lt;t&lt;10000)</code> - the number of test cases then <code>t</code> test case follows
  the only line of the test case contains two integers <code>a,b(1&lt;=a,b&lt;=10^9)</code></p>
  </blockquote>
  <blockquote>
  <p>Output:
  For each test case print the answer the minimum number of moves you need to do in order to <code>a</code> divisible by <code>b</code></p>
  </blockquote>
  <p>Here is my code:</p>
  <pre class="lang-c prettyprint-override"><code>#include &lt;math.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  int main()
  {
    long long int t, a, b;
    int value, count = 0, i, j;
    scanf(&quot;%lld&quot;, &amp;t);
    if (t &gt;= 1 &amp;&amp; t &lt;= pow(10, 4))
    {
      for (j = 1; j &lt;= t; j++)
      {
        scanf(&quot;%lld %lld&quot;, &amp;a, &amp;b);
        if ((a &gt;= 1 &amp;&amp; a &lt;= pow(10, 9)) &amp;&amp; (b &gt;= 1 &amp;&amp; b &lt;= pow(10, 9)))
        {
          value = a;
          for (i = 1; a % b != 0; i++)
          {
            count++;
            a = (value + i);
          }
  
          printf(&quot;%d\n&quot;, count);
          a = 0;
          b = 0;
          count = 0;
        }
      }
    }
    return 0;
  }
  </code></pre>