Q. What is the output of the following code snippet? int x = 10; int *ptr = &x; cout << *ptr;
β
Correct Answer: (A)
10
Explanation: The pointer 'ptr' points to x, and *ptr dereferences it to give the value of x, which is 10.