title: While loop go through irrespective of conditions in C
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;ctype.h&gt;
  
  
  int main(void){
      int corX = 0;
  
      do{
          printf("Please enter number X:\n");
          scanf("%d",&amp;corX);
      } while(!(isdigit(corX) &amp;&amp; corX&gt;1 &amp;&amp; corX&lt;80));
  
      printf("You entered X as: %d\n",corX);
      return 0;
  }
  </code></pre>
  
  <p>Hi! The code above should check if the entered value is an integer and fit to the range. If not, program should ask again. Unfortunately, it does not work in this way. Whatever I write, loop always go through and in a result I receive entered number for numbers and 0 for other signs. Could somebody explain, what I am doing wrong?</p>