Examveda

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char *str = "hello, world";
    char str1[15] = "hello wo 9";
    strcpy(str, str1);
    printf("%s", str1);
}

A. Compilation error

B. Segmentation Fault

C. hello, world

D. hello, wo 9

Answer: Option B


This Question Belongs to C Program >> File Input Output

Join The Discussion

Related Questions on File Input Output