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

101



Your comments will be displayed only after manual approval.