Computer Science, asked by hemlalkumardas17871, 1 month ago

*(&num) is equivalent to writing (a) &num (b) *num (c) num (d) none of these.​

Answers

Answered by lourdunive1998
0

Answer:

d ) none of these

Explanation:

dddddddddd

Answered by pruthaasl
0

Answer:

*(&num) is equivalent to writing (d) none of these.​

Pointers:

  • Pointer is a data type and a powerful technique to access the data by indirect reference.
  • A pointer is a variable that contains the memory address of another variable.
  • A pointer contains a memory address. This address is the location of some other variable in the memory.
  • A pointer variable has two parts, the pointer operator and the address operator.
  • A pointer operator can be represented by a combination of * (asterisk) with a variable. Example: int *ptr
  • An address operator can be represented by a combination of & (ampersand) with a pointer variable. Example: m = &ptr

Explanation:

  1. In *(&num), higher precedence is given to parenthesis. Therefore, (&num) will be executed first.
  2. Because of the address operator, the &num gets the address of the variable num.
  3. The asterisk (*) is the pointer operator and the variable mentioned in front of it points to an address.
  4. Therefore, the expression *(&num) takes the address of num variable and makes it act like a pointer variable.

(d) none of these: As none of the given options match with the output of the given expression, this is the correct answer.

Explanation for incorrect answers:

(a) &num: The ampersand operator is the address operator. So, this expression gives the address of the num variable.

(b) *num: Here, num is the pointer variable and will point to the address of a particular variable.

(c) num: num is simply a declared variable.

Therefore, *(&num) is not equivalent to any of the given options.

#SPJ3

Similar questions