title: How can I cast (n+n%2) expression to float so it will give me float number after division?
body: <p>I am trying to get float number result from this c++ code, but i cannot for some reason:</p>
  <pre><code>int n = 5;
  
  std::cout &lt;&lt; static_cast&lt;float&gt;(n + n % 2) / 2 &lt;&lt; std::endl;
  </code></pre>
  <p>Console output is 3. Could you explain what I am missing in this expression?</p>