#include
int main() { char str[100], ch;
printf(“Enter a string: “); fgets(str, sizeof(str), stdin);
printf(“Enter the character to delete: “); scanf(“%c”, &ch); // Fixes issue by reading the next character input
int i, j = 0; while (str[i] != ‘\0’) { if (str[i] != ch) { str[j++] = str[i]; } i++; } str[j] = ‘\0’;
printf(“Modified string: %s\n”, str);
return 0; }
Enter a string: df Enter the character to delete: f Segmentation fault