Vidyalelo
C Programming · Q109

Pointer

Programming · C Programming · question 109

Q109

What will be the output of the following C code? #include int main() char *str = "hello, world "; char *strc = "good morning "; strcpy(strc, str); printf("%s ", strc); return 0;

A.
hello, world
B.
Crash/segmentation fault
Answer
C.
Undefined behaviour
D.
Run time error

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board