Home » C Programming » Functions » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    struct Z
    {
    char *name;
    struct Z *next;
    };
    struct Z *ptrary[10];
    int main()
    {
    struct Z z;
    z.name = "Raj";
    z.next = NULL;
    ptrary[0] = &z;
    printf("%s\n", ptrary[0]->name);
    return 0;
    }
    1. Compilation Error
    2. Garbage value
    3. Raj
    4. Undefined behaviour
    5. None of these
Correct Option: C

Raj



Your comments will be displayed only after manual approval.