#include <stdio.h>
#include <string.h>
void remove_all_occurrences(char s[], char ch) {
int len = strlen(s);
for (int i = 0; i < len; i++) {
if (s[i] == ch || s[0] == ' ') {
for (int j = i; j < len; j++) {
s[j] = s[j + 1];
}
len--;
i--;
}
}
}
int main() {
char s[] = "c c++ c# java php python cobol";
remove_all_occurrences(s, 'p');
puts(s);
remove_all_occurrences(s, 'x');
puts(s);
remove_all_occurrences(s, 'c');
puts(s);
return 0;
}
/*
run:
c c++ c# java h ython cobol
c c++ c# java h ython cobol
++ # java h ython obol
*/