Multiple choice technology programming languages

void main() { char *p = "ayqm"; char c; c = ++*p++; printf("%c",c); }

  1. a

  2. b

  3. y

  4. z

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

The expression ++p++ combines pre-increment (++), dereference (), and post-increment (++). Pre-increment has highest precedence: ++*p means increment the value p points to ('a' becomes 'b'). Then p++ advances the pointer. So c gets 'b'.