Extern variables are initialized to zero by default and are globally accessible.
Extern variables must be defined exactly once, outside any function- this sets aside storage for it. And the function that wants to access the extern variable must declare it before using it.
Just put extern declaration outside the function and you get answer 0,90. 0 as extern is initialized to 0 by default and 90 after p is assigned value.
#include <stdio.h>
extern int p;
int main()
{
int p;
printf("%d ", p);
{
int p = 90;
printf("%d ", p);
}
}