/* Counts only the numeric characters '0' - '9' read from standard input */ #include int main( void ) { int c, n = 0; while ( ( c = getchar() ) != '\n' ) { if ( c >= '0' && c <= '9' ) n = n + 1; } printf( "Count of digits = %d\n", n ); }