Examveda
Examveda

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char *str = "hello, world\n";
    char *strc = "good morning\n";
    strcpy(strc, str);
    printf("%s\n", strc);
    return 0;
}

A. hello, world

B. Crash/segmentation fault

C. Undefined behaviour

D. Run time error

Answer: Option B


This Question Belongs to C Program >> Pointer

Join The Discussion

Related Questions on Pointer