Recently I have installed Ubuntu and obviously I am compiling my C code in gcc
. I came across the following code :
#include <stdio.h>
main()
{
int i = 10,j = 20, k;
printf("i=%d j=%d k=%d\n", i, j, k);
}
The output is coming as ::
i=10 j=20 k=0
But as far as I know that the output for the value of k should be a Garbage value since it has not been initialized.
Is there something that I am missing here?