Skip to content

Instantly share code, notes, and snippets.

@aditya0072001
Created February 11, 2019 16:00
C program to remove an element 'e' from the string
#include<stdio.h>
void main()
{
char arr[20];
int i,j;
printf("\nEnter a string :");
scanf("%s",arr);
for(i=0;arr[i]!='\0';i++)
{
if(arr[i]=='e')
{
for(j=i;arr[j]!='\0';j++)
{
arr[j]=arr[j+1];
}
}
}
printf("\n%s",arr);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment