Home » C Programming » Structures » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    typedef struct N *ptr2;
    struct N
    {
    int n1;
    char n2;
    ptr2 ptr1;
    };
    int main()
    {
    struct N n = {111, 222, &n};
    printf("%d\n", n.ptr1->ptr1->n1);
    return 0;
    }
    1. 111
    2. 222
    3. Compilation Error
    4. Garbage value
    5. None of these
Correct Option: A

111



Your comments will be displayed only after manual approval.