title: What is wrong with this scanf usage?
body: <p>Here is a five digit number as input. I want this is program to calculate the sum of its digits and when I run program in dev compiler it stops responding and it give 255 as output for every five digit number.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  void main()
  {
      int n, a, b, c, d, e, f;
      printf("entre a no ");
      scanf("%d",n);
  
      a = n % 10;
      n = n / 10;
      b = n % 10;
      n = n / 10;
      c = n % 10;
      n = n / 10;
      d = n % 10;
      n = n / 10;
      e = n;
      f = (a + b + c + d + e);
      printf("sum of five digit=%d",f);
  }
  </code></pre>
  
  <p>The expected output is the sum of the five digits.</p>
  
  <p>But it always stops responding and it shows a dialog box asking me to close the program. After closing the program it always gives an output of 255, whatever the input number is.</p>