I am a noob so plz be merciful,
in the code given below, plz focus on array named B, numbers at position 0 and 2 are declared as 1 and 3, and number on 1st position is not declared, when i run it on an online compiler like onlinegbd, or programiz etc,
#include <stdio.h>
int main()
{
int j, B[3];
B[0]=1;
B[2]=3;
for (j=0; j<3; j++)
{
printf("%d\n", B[j]);
}
return 0;
}
the output is
1
0
3
but when I run the same program on my compiler (MinGW) and code blocks (software), I get
1
-1405179899
3
or
1
-1895397996
3
so i am not sure what to say here, it also gives positive values as shown in the title as well, plz help me