Vidyalelo
C Programming · Q217

File Input Output

Programming · C Programming · question 217

Q217

What will be the output of the following C code? #include struct p struct p *next; int x; ; int main() struct p *p1 = calloc(1, sizeof(struct p)); p1->x = 1; p1->next = calloc(1, sizeof(struct p)); printf("%d ", p1->next->x); return 0;

A.
Compile time error
B.
1
C.
Somegarbage value
D.
0
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board