title: Difference between reading a variable using scanf and assignment
body: <pre><code>int main()
  {
    int i,j;
    i='c';
  
    scanf("%d",&amp;j);   // I will read 'c' here 
  
    printf("%d %d",i,j);
  
  }
  </code></pre>
  
  <p>Output is not same.<code>'j'</code> takes garbage value and <code>'i'</code> takes ascii value of <code>'c'</code>. Can anybody tell what could be the reason ? </p>