title: How can I add two different data types char and int in c language?
body: <p>This is the code; and in this one a + c gives me result in digit, why? The output below. How the character is converted into a digit? And why 125 + 'c' = 212? Thank you in response!</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
  
      int a = 125, b = 12345;
      long ax = 1234567890;
      short s = 4043;
      float x = 2.13459;
      double dx = 1.1415927;
      char c = 'W';
      unsigned long ux = 2541567890;
      printf(&quot;a + c =  %d\n&quot;, a + c);
      printf(&quot;x + c = %f\n&quot;, x + c);
      printf(&quot;dx + x = %f\n&quot;, dx + x);
      printf(&quot;((int) dx) + ax =  %ld\n&quot;, ((int) dx) + ax);
      printf(&quot;a + x = %f\n&quot;, a + x);
      printf(&quot;s + b =  %d\n&quot;, s + b);
      printf(&quot;ax + b = %ld\n&quot;, ax + b);
      printf(&quot;s + c =  %hd\n&quot;, s + c);
      printf(&quot;ax + c = %ld\n&quot;, ax + c);
      printf(&quot;ax + ux = %lu\n&quot;, ax + ux);
      return 0;
  }
  </code></pre>
  <p>Sample output:</p>
  <pre><code>a + c =  212                                                           
  x + c = 89.134590                                                      
  dx + x = 3.276183                                                      
  ((int) dx) + ax =  1234567891                                          
  a + x = 127.134590                                                     
  s + b =  16388                                                         
  ax + b = 1234580235                                                    
  s + c =  4130                                                          
  ax + c = 1234567977                                                    
  ax + ux = 3776135780
  </code></pre>