

MCQOPTIONS
Saved Bookmarks
1. |
What will be the output of the following C code?#include <stdio.h> struct p { struct p *next; int n; }; int main() { struct p *ptr1 = calloc(1, sizeof(struct p)); ptr1->n = 1; ptr1->next = calloc(1, sizeof(struct p)); printf("%d n", ptr1->next->n); return 0; } |
A. | 0 |
B. | 1 |
C. | Somegarbage value |
D. | Compilation Error |
E. | None of these |
Answer» B. 1 | |