title: How to restrict the user to only input whole number and refuse any other characters in scanf?
body: <p>I'm trying to get user input and allowing them to only input a whole number which is also positive.</p>
  
  <p>I'm trying to figure out this task</p>
  
  <pre><code>printf("Enter the first and second number in whole number: ");
  scanf("%d,%d", &amp;first, &amp;second);
  
  if (input != '\n') //notice this line I'm trying to check if is a character//
      printf("Error! CHARACTER NOT ACCEPTED!!\n");
  
  else if (First &lt;= 0)
      printf("Error! First must be a positive value!\n");
  
  else if (Second &lt;= 0)
      printf("Error Second must be a positive value!\n");
  </code></pre>
  
  <p>The code above will check for two things. One, if the user has input the characters I want. Second, if the number is positive.</p>
  
  <p>How do I realize these checks?</p>