Consider the following C++ code segment: int a = 10, b = 20; int *p = &a, *q =…

PYQ DSSSB 2018

Consider the following C++ code segment:
int a = 10, b = 20;
int *p = &a, *q = &b;
p = q;
With respect to the code segment mentioned above, which of the following statement is correct?

  1. A.

    Both a and b will contain 10

  2. B.

    Both a and b will contain 20

  3. C.

    Both p and q will point to a

  4. D.

    Both p and q will point to b

Attempted by 876 students.

Sign up free to check your answer

Sign up free

Explore the full course: Dsssb Tgt Computer Science Paper 2

Loading lesson…