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