Removing all e by x in a string.
Removing all e by x in string.
Hello,friends in this tutorial you will come across the concept that how to remove all e by x in a string.This is simple programme and general programme in c language.Following method has used in programme
- Take one input string from user.
- Find the length of string using strlen() function.
- Run the iteration till the length of string.
- Apply the condition of finding e or E in string.
- If the condition success then remove e by x .
- Then print the new string.
Removing all e by x
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
char str[30];
int i,len=0;
printf("Enter string\n");
gets(str);
len=strlen(str);
for(i=0;i<len;i++)
{
if(str[i]=='e'||str[i]=='E')
{
str[i]=x;
}
}
printf("String after removing e or E is :%s",str);
getch();
}
output will be like this:
Enter string
DeEpak
String after removing e or E is:Dxxpak
Removing all e by x in a string.
Reviewed by Deepak kumar soni
on
December 22, 2018
Rating:
No comments: