I have the following code snippet.
int j;
printf("%d",j);
As expected, I get a garbage value.
32039491
But when I include a loop in the above snippet, like
int j;
print("%d",j);
while(j);
I get the following output on multiple trials of the program.
0
I always thought local variables are initialized to a garbage value by default, but it looks like variables get auto initialized when a loop is used.