Online Compiler C

#include <stdio.h> int main() { char c; int a=0; for(;;){ c=getchar(); if (c=='.')break; if (c>='0'&&c<='9')a++; } printf("%d",a); return 0
The code reads characters from input until a period ('.') is encountered, and counts how many of those characters are digits ('0' to '9'). It then prints the count.

- The program has a missing semicolon after `return 0`. Check the line before the closing brace.
- The variable `c` is declared as `char`, but `getchar()` returns an `int`. This can cause issues when comparing with `EOF` or handling certain characters. Consider the type of `c`.