title: Why does C compare 3 as equal to 3.0?
body: <p>The problem is I can't understand how computer understood that 3 and 3.0 are the same in the very first place.</p>
  
  <p>I think INT would get implicitly converted to FLOAT?</p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int a=3;
      float b=3.0;
      if(a==b)
          printf("s");
      else
          printf("w");
      return 0;
  }
  </code></pre>
  
  <p>I'm expecting the output of the code to be w, but the actual output is s.
  why? and please explain to me the perspective of the computer.</p>