int main() { int ch; printf("please input a digital(between 0 and 9):\n"); scanf("%d", &ch); if(ch >= 0 && ch <= 9) { printf("%c", '0'+ch); }else{ printf("input error!\n"); } }