0
What is the output of the following code? #include <stdio.h>
void func(int *p) {
int q = 10;
p = &q;
}
int main() {
int x = 20, *ptr = &x;
func(ptr);
printf("%d\n", *ptr);
return 0;
}- ACompile time error
- B20
- C10
- DGarbage value
Correct answer: B