C program to remove all occurrences of a character from the entered string using a while a loop.| सी प्रोग्राम एक लूप का उपयोग करते हुए दर्ज स्ट्रिंग से एक चरित्र की सभी घटनाओं को हटाने के लिए।












C program to remove all occurrences of a character from the entered string using a while a loop.




C program to remove all occurrences of a character from the entered string using a while a loop.



#include <stdio.h> #define MAX 100 void removeA(char *, const char); int main() { char text[MAX]; char remove; printf("\n Enter any string: "); gets(text); printf("\n Enter the character to remove from the entered string: "); remove = getchar(); removeA(text, remove); printf("String after removing '%c': %s", remove, text); return 0; } void removeA(char * text, const char remove) { int i, j; int len = strlen(text); for(i=0; i


Output:

Enter any string: c programming coding dot com Enter the character to remove from the entered string: o String after removing 'o': c prgramming cding dt cm



Exercise: 1
C program to remove all occurrences of a character from string.