Learn how to write a C program to replace a character in a given string with step-by-step explanation and sample output.