Home » C Programming » Strings » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    char *s = "Interview, Mania";
    char s1[20] = "hello Interview Mania";
    strcpy(s, s1);
    printf("%s", s1);
    }
    1. Segmentation fault
    2. Compilation Error
    3. Interview, Mania
    4. hello Interview Mania
    5. None of these
Correct Option: A

Segmentation fault



Your comments will be displayed only after manual approval.