Is it a digit
#include <ctype.h> #include <stdio.h> int main(void) { char ch; for(;;) { ch = getchar(); if(ch == '.') break; if(isdigit(ch)) printf("%c is a digit\n", ch); } return 0; }