Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    char *ch[20] = {"Welcome", "to", "Interview mania"};
    int n = 0;
    for (n = 0; n < 20; n++)
    printf("%s", *(ch[n]));
    }
    1. Welcome to Interview mania
    2. Compilation Error
    3. Garbage value
    4. Segmentation fault
    5. None of these
Correct Option: D

Segmentation fault



Your comments will be displayed only after manual approval.