title: In the following c program if condition is not working
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;conio.h&gt;
  #include &lt;ctype.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  main()
  {
      int iRandom;
      int iResponse;
      srand(time(0));
  
      iRandom = (rand() % 10) + 1;
  
      printf("\nGuess a number between 1 and 10: ");
      scanf("%c", &amp;iResponse);
  
      if (isdigit(iResponse)) {
  
          iResponse = iResponse - '0';
  
          if (iResponse &gt;=1 &amp;&amp; iResponse &lt;=10 ) {
  
  
              if (iResponse == iRandom) {
                  printf("\nYou guessed right.\n");
              }
              else {
                  printf("\nSorry, you guessed wrong.\n");
                  printf("The correct guess was %d\n", iRandom);
              }
          }
          else {
              printf("You did not enter a digit between 1 and 10.");
          }
  
      }
      else {
          printf("\nYou did not enter a digit.\n");
      }
  
      getch();
      return 0;
  }
  </code></pre>
  
  <p>Check this out condition if (iResponse >=1 &amp;&amp; iResponse &lt;=10 ) is not working.
  in this condition if iResponse &lt;= 10 is false then it will not execute the else part.
  Any Solution plz help me.</p>