title: Printing Integer value of character variable in C
body: <p>Recently in my Institute I was given a code and was asked to find out the answer. The code looks like this.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
      char ch=500;
      printf("%d\n",ch);
  }
  </code></pre>
  
  <p>The output will come as <code>-12</code></p>
  
  <p>My question is: How can I calculate the value for this kind of code?  Is there any formula or process for finding the values?</p>