title: Division In C++ and java?
body: <p>In C++ according to user input programmer able to find the final value is what double or int using this code.If 4/2 the answer is 2 Not 2.0. If 5/3 the answer is 1.66667 not 1. </p>
  
  <pre><code>float a;
  float b;
  cin &gt;&gt; a &gt;&gt; b;
  float z = a / b;
  cout &lt;&lt; z &lt;&lt; endl;
  </code></pre>
  
  <p>Simple thing is if user input is 2/4 the answer is 2 not 2.0. And if user input is 5/3 the answer is 1.66667 not 1 according to my c++ code. Can anybody do this same think in java Please?</p>
  
  <p>Everybody know in calculator if we type 4/2 the answer is 2 not 2.0. And if we type 5/3 the answer is 1.66667 not 1. I just want to create something program like that i think now you understand me.</p>