Answer:Consider the following code segment:
int main()
{
int x, *x_ptr=&x;
x=5;
x_ptr=NULL;
cout<< x << “ “ << *x_ptr;
return 0;
}
What is the output of the above code?
Options
a) <hexadecimal address> 0
b) <hexadecimal address> <hexadecimal address> but addresses are same
c) <hexadecimal address> <hexadecimal address> but having different addresses
d) <hexadecimal address> 5
Answer : a) <hexadecimal address> 0