title: Are 3.5 and 3.5f the same in C++?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1839422/strange-output-in-comparision-of-float-with-float-literal">strange output in comparision of float with float literal</a><br>
    <a href="https://stackoverflow.com/questions/6722293/why-comparing-double-and-float-leads-to-unexpected-result">Why comparing double and float leads to unexpected result?</a>  </p>
  </blockquote>
  
  
  
  <p>In following code I was expecting answer to be "Not equal", because by default the <code>3.5</code>  should be <code>double</code> in C++, but the result was "equal". </p>
  
  <p>What is difference in declaring <code>float a=3.5f</code> and <code>float a=3.5</code>?</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      float a=3.5;
      if(a==3.5)  
          cout&lt;&lt;"equal"&lt;&lt;endl;
      else
          cout&lt;&lt;"Not equal"&lt;&lt;endl;
      return 0;
  }
  </code></pre>