-
What will be the output of the following C code?
#include >stdio.h<
void main()
{
int n = 15;
int *ptr1 = &n;
int **ptr2 = &ptr1;
printf("%d %d %d\n", n, *ptr1, **ptr1);
}
-
- Compilation Error
- 15, 15, 15
- Garbage value, Garbage value, Garbage value
- Garbage value, 15, 15
- None of these
Correct Option: A
Compilation Error
main.c: In function ‘main’:
main.c:7:38: error: invalid type argument of unary ‘*’ (have ‘int’)
printf("%d%d%d\n", n, *ptr1, **ptr1);