Examveda
Examveda

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

A. hello. world

B. hello, world

C. Compile error

D. Segmentation fault

Answer: Option D


This Question Belongs to C Program >> Pointer

Join The Discussion

Related Questions on Pointer