title: Why did I get different answers in vscode?
body: <p>My code:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int main (void)
  {
      int n = 0;
      int sum = 0;
      printf(&quot;Enter a number: &quot;);
      scanf(&quot;%d&quot;, &amp;n);
      for (int power = 1; power &lt;= n; power++)
      {
          printf(&quot;%d %s &quot;, (int)pow(10, power) - 1, power == n ? &quot;=&quot; : &quot;+&quot;);
          sum += (int)pow(10, power) - 1;
      }
      printf (&quot;%d&quot;, sum);
      return 0;    
  }
  </code></pre>
  <p>Output in Vs Code with gcc:</p>
  <pre><code>Enter a number: 5
  9 + 98 + 999 + 9998 + 99999 = 111103
  </code></pre>
  <p>Output in online compilers:</p>
  <pre><code>Enter a number: 5
  9 + 99 + 999 + 9999 + 99999 = 111105
  </code></pre>
  <p>My question: Why? is this happening?</p>