Question 96
What is the output of the following C program?
C
#include <stdio.h>
int main(void) {
int arr[] = {11, 55, 30, 40};
int *p = arr;
printf("%d", *(p + 1) - *p);
return 0;
}Detailed Solution
*(p + 1) accesses arr[1] (55) and *p accesses arr[0] (11). The difference is 55 - 11 = 44.
✓ Saved