39
Technically this is UB (Undefined behaviour).
int g;
int p=scanf("%d",g);
^
You passing an unitialized integer to scanf to use it as an address to write to. From this point on, anything can happen. Most likely your app is going to crash.