Multiple choice technology programming languages

What will be the output of the following program : void main() { int x=4,y=3,z=2; &z=&x*&y; printf("%d",z); }

  1. Compile-Time error

  2. Run-Time Error

  3. 24

  4. Unpredictable

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

*&z is a pointer dereference of z's address, which just gives z. *&z *= *&x * *&y becomes z *= x * y, or z = 2 * 4 * 3 = 24. The *& operators cancel out - & takes address, * dereferences it. This is a pointer trick question testing understanding of address and dereference operators.