Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    char *ch[10] = {"Interview", "Mania", "World"};
    int k = 0, L = 0;
    ch[0] = "World";
    for (k = 0; k < 10; k++)
    printf("%s\n", ch[k]);
    }
    1. Interview
    2. Mania
    3. World
    4. Garbage value
    5. Segmentation fault
Correct Option: E

Segmentation fault



Your comments will be displayed only after manual approval.