Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    char *str = "Interview, Mania\n";
    char *strc = "Welcome to\n";
    strcpy(strc, str);
    printf("%s\n", strc);
    return 0;
    }
    1. Interview, Mania
    2. Welcome to
      Interview, Mania
    3. Undefined behaviour
    4. Crash/segmentation fault
    5. None of these
Correct Option: D

Crash/segmentation fault



Your comments will be displayed only after manual approval.