title: How to use decimal fractions in c++
body: <p>How can i make it understand decimal fractions, because most of the time bulviukaina,mesoskaina and miltukaina are gonna be decimal fractions? and when i enter bulviukaina as a decimal fraction it calculates instantly without being able to insert mesoskaina and miltukaina?</p>
  <p>i tried writing the numbers as 0,99  0.99 and 99/100</p>
  <p>any ideas? im new to c++</p>
  <pre><code># include &lt;bits/stdc++.h&gt;
  using namespace std;
  int main ()
  {
  int bulviukiekis, mesoskiekis, miltukiekis, bulviukaina, mesoskaina, miltukaina, 
  bendrakaina;
  cout&lt;&lt;&quot;Bulviu kiekis = &quot;;
  cin&gt;&gt;bulviukiekis;
  cout&lt;&lt;&quot;Mesos kiekis = &quot;;
  cin&gt;&gt;mesoskiekis;
  cout&lt;&lt;&quot;Miltu kiekis = &quot;;
  cin&gt;&gt;miltukiekis;
  cout&lt;&lt;&quot;Bulviu kaina = &quot;;
  cin&gt;&gt;bulviukaina;
  cout&lt;&lt;&quot;Mesos kaina = &quot;;
  cin&gt;&gt;mesoskaina;
  cout&lt;&lt;&quot;Miltu kaina = &quot;;
  cin&gt;&gt;miltukaina;
  bendrakaina=((bulviukiekis*bulviukaina)+(mesoskiekis*mesoskaina)+ 
  (miltukiekis*miltukaina))*4;
  cout&lt;&lt;&quot;Seima per menesi bulvems, mesai ir miltams isleidzia &quot;&lt;&lt;bendrakaina&lt;&lt;&quot; Eur&quot;;
  
  return 0;
  </code></pre>