in fun() p is the copy of the main functions pointer p..hence any change in the pointer p in fun()...does not affect the pointer p in main fun()...thus when fun() returns to the main fun()..that copy of the local variables and pointers gets deleted..hence the pointer p keeps on pointing to r whose value is 20. Always remember-if we want to change a local pointer of one function inside another function, then we must pass pointer to the pointer. By passing the pointer to the pointer, we can change pointer to point to something else.
Hence option B is correct.