Input
Enter a string : playwithcoding
Output
After removing vowel from string: plywthcdng
Step 1: START
Step 2: Enter a string as an input.
Step 3: Check each character of the string:
if ch[i]=A,E,I,O,U or a,e,i,o,u
countinue;
else
print str[i];
Step 4: END
/* remove vowel from string */
#include <stdio.h>
#include <string.h>
int main()
{
char str[30];
printf(" Enter a string: ");
gets(str);
printf("After removing vowel from string : ");
for(int i=0;str[i];i++)
{
if(str[i]=='A'||str[i]=='a'||str[i]=='E'||str[i]=='e'||str[i]=='I'||str[i]=='i'||str[i]=='O'||str[i]=='o'||str[i]=='U'||str[i]=='u')
continue;
else
printf("%c",str[i]);
}
return 0;
}
/* remove vowel from string */
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char str[30];
cout<<" Enter a string: ";
gets(str);
cout<<"After removing vowel from string : ";
for(int i=0;str[i];i++)
{
if(str[i]=='A'||str[i]=='a'||str[i]=='E'||str[i]=='e'||str[i]=='I'||str[i]=='i'||str[i]=='O'||str[i]=='o'||str[i]=='U'||str[i]=='u')
continue;
else
cout<<str[i];
}
return 0;
}
Enter a string : playwithcoding
After removing vowel from string: plywthcdng
advertisment