@ SKP
Yes, because you use
const int i=10;
if there is no constant then error is given.
Because all objects with static storage duration must be initialized (set to their initial values) before execution of main() starts.
here after main() function declared we write this line
static int x=i;
that's why it gives error .