title: please explain this weird behaviour c++ multiplying numbers then mod
body: <p>i have less experience with c++ and i code mainly in python. while solving some programming challenge online there was a part of code where i have to multiply two numbers and reduced it with mod.</p>
  
  <pre><code>v = (u*node) % 100000
  </code></pre>
  
  <p>where u and node are int values with range 1 - 100000. Due to time limit issues i wrote my code in c++. Here what i wrote</p>
  
  <pre><code>long long v = (u * node) % 100000;
  </code></pre>
  
  <p>while submitting i got runtime error in all the test cases. I downloaded failed test cases and ran in my local computer and i was getting perfect output. </p>
  
  <p>After seeing editorial, i change that line to something like this </p>
  
  <pre><code>long long v = u;
  v = (v*node) % 100000;
  </code></pre>
  
  <p>and submitted. I passed all the test cases. Please can anyone explain whats the difference between those two lines..</p>
  
  <p>variable data types - </p>
  
  <pre><code>int u
  int node
  </code></pre>