Multiple choice technology programming languages

What is the output ? main() { int x=2000, *p, y = 200; p = &y; x = x/*p; printf("%d", x); }

  1. 10

  2. Garbage value

  3. 100

  4. Compilation error

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

The line x = x/p causes a compilation error because / is interpreted as the start of a C comment. The compiler looks for a closing */ but never finds one, resulting in a compilation error. To correctly divide x by the value pointed to by p, parentheses are needed: x = x/(*p).