#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void){
int corX = 0;
do{
printf("Please enter number X:\n");
scanf("%d",&corX);
} while(!(isdigit(corX) && corX>1 && corX<80));
printf("You entered X as: %d\n",corX);
return 0;
}
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?