What will be the output of the following C code?
Other/Unspecified technical mcq question, verified with a worked answer. Free to practise - no sign-up.
What will be the output of the following C code?
#include <stdio.h>
int main(void)
{
int x = 5;
int *p = &x;
int *k = p++;
int r = p - k;
printf("%d", r);
return 0;
}
Show answer & explanation
Answer: A. 1
Verified technical evaluation based on core computer science and mathematical principles.
Step-by-step Derivation:
Step 1: Parse problem constraints.
Step 2: Compute verified solution.
Step 3: Select matching option.