#include
int main()
{
char *name = \"Vikram\";
printf(\"%s\",name);
name[1]=\'s\';
printf(\"%s\",name);
return 0;
}
By default when stdout is connected to a terminal, the stream is line-buffered. In practice, in your example the absence of '\n' (or of an explicit stream flush) is why you don't get the characters printed.
But in theory undefined behavior is not bounded (from the Standard "behavior [...] for which this International Standard imposes no requirements") and the segfault can happen even before the undefined behavior occurs, for example before the first printf call!