title: How to validate user input?
body: <p>In the program written below how i can ensure that only integer value is entered?
  And if character is entered the program should convert it to its ASCII equivalent and then add them and show output as number.
  Please help me......</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main(int argc, char **argv)
  {
   int a,b,c;
   printf("enter two numbers:-");
   scanf("%d \t %d",&amp;a,&amp;b);
   c=a+b;
   printf("addition of numbers= %d",c);
  }
  </code></pre>