I have the below C code and I am expecting it to throw an error like "multiple declaration of variable", but it is not doing so.
#include <stdio.h>
int i;
int i;
int main()
{
printf("%d",i);
return 0;
}
Now the output is 0
, but why?
And one more thing below code gives error what is expected
#include <stdio.h>
int main()
{
int i;
int i;
printf("%d",i);
return 0;
}
O/p is error saying re declaration of i