I normally use a code like this to read and int between some range:
But suppose I input something not a digit... this will go into a loop printing "Integer :" and will not end until I Ctrl+C or Ctrl+Z. How can I ask the user to input again if he did not inputed a digit on the first place?Code:do { printf("Integer: "); scanf("%d%*c", &value); } while(value < 1 || value > 10);