title: how char is changed to int while doing calculations in c?
body: <p>In the below program the output is "Not same" although a and b have the same value? I googled it and found that the value of the a and b is converted to int.And new value of a is -5 and that of b is 251.I am not getting how they are becoming so different after typecasting?
  a in binary is 11111011 and b is 11111011 so when they are typecasted into int
  a should become -53, how it is -5 .Please explain?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main(){
  char a = 0xfb;
  unsigned char b = 0xfb;
  
  printf("a = %c", a);
  printf("\nb = %c", b);
  
  if (a == b)
    printf("\nSame");
   else
   printf("\nNot Same");   
   return 0;
  } 
  </code></pre>