C language delete c or C in the string
1. Enter the code and the result is as follows.
Enter some strings, the program automatically deletes c or C, and the results are as follows.
2. Source code
#include <stdio.h>
#include <string.h>
void main ()
{
char s[100];
gets(s);
{
int n,i,j;
n=strlen(s);
for (i=0;i<=n;i++)
{
if(s[i]=='c'||s[i]=='C')
{for (j=i;j<=n;j++)
s[j]=s[j+1];}
}
printf("%s\n",s);
}
}