Multiple choice technology programming languages

void main() { int i = 10; long *p=&i; p++; printf("%d",abs(&i-p)); }

  1. compile error

  2. 2

  3. 1

  4. 10

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

The code attempts to assign the address of an integer variable to a long pointer without an explicit cast, and furthermore tries to subtract pointers of different sizes. This causes a compile-time error in standard C.