-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int array[3] = {16, 17, 18};
int *p = &array[1];
float m = 1;
p = p + m;
printf("%d\n", *p);
}
-
- 16
- 17
- 18
- Compilation Error
- Garbage value
Correct Option: D
Compilation Error
main.c: In function ‘main’:
main.c:7:15: error: invalid operands to binary + (have ‘int *’ and ‘float’)
p = p + m;