Home » C Programming » Structures » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    struct Employee
    {
    char *ch;
    };
    void main()
    {
    struct Employee *e;
    e->ch = "Prayag";
    printf("%s", e->ch);
    }
    1. Compilation Error
    2. Segmentation fault
    3. Garbage value
    4. Prayag
    5. None of these
Correct Option: B

Segmentation fault



Your comments will be displayed only after manual approval.