Static and global variables are initialized to 0 by default so it's perfectly normal
The C standard ISO/IEC 9899:1999 a.k.a. C99 (and C++) standards say this must be so. See item 10 in section 6.7.8 ("Initialization") of WG14 N1256 for the exact text (https://stackoverflow.com/a/1294780/1938163)
By the way: it is good practice to initialize static variables, also just to render the code more readable!
static int myvar = 0;
Another drawback of not initializing them: if a compiler doesn't follow the standard, you might get in trouble
With regard to local variables that are both NOT static and NOT global, well, you might skip their initialization but that would yield undefined behavior. Don't really rely on it.