Why local variable is initialized to zero

view story

http://stackoverflow.com – According to my knowledge, local variables are uninitialized i.e, it contains garbage value. But following program is giving 0 (zero) as output. main() { int i; printf("%d\n",i); } When i run above program it is giving always 0. I know that 0 is also can be a garbage value but every time i am getting zero as output. Can anybody know reason for it? (HowTos)