title: Turbo C++ Result not coming ok with long int
body: <p>I am facing issue with result output with <code>long int</code>. Here Below is my Program, I am calculating tax with various methods 1) taking result output in <code>int</code> and <code>long</code> variable. I think all the four results in my code should be the same, but result output in <code>tax3</code> variable is coming different (less by 1) than other three. please help me to understand the reason. </p>
  
  <pre><code>#include&lt;iostream.h&gt;
  #include&lt;conio.h&gt;
  
  int main()
  {
      long salary;
      cout &lt;&lt; "Enter Salary: " &lt;&lt; endl;
      cin&gt;&gt;salary;
      float tax1, tax2;
      long tax3, tax4;
      tax1 = salary*0.15;
      tax2 = (salary*15)/100;
      tax3 = salary*0.15;
      tax4 = (salary*15)/100;
      cout &lt;&lt; "tax1=" &lt;&lt; tax1 &lt;&lt; endl;
      cout &lt;&lt; "tax2=" &lt;&lt; tax2 &lt;&lt; endl;
      cout &lt;&lt; "tax3=" &lt;&lt; tax3 &lt;&lt; endl;
      cout &lt;&lt; "tax4=" &lt;&lt; tax4 &lt;&lt; endl;
      getch();
      return(0);
  }
  </code></pre>