#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char test[256];
int x,i;
int vowels;
cout<<"please enter a word";
gets(test);
x = strlen(test);
for(i=0;i<=x-1;i++)
{
if(test[i]!=' ')
{
cout<<test[i]<<endl;
}
if (test[i]=='a' || test[i]=='e' || test[i]=='i' || test[i]=='o' || test[i]=='u' || test[i]=='A' || test[i]=='E' || test[i]=='I' || test[i]=='O' || test[i]=='U') {
test[i]=' ';
}
}
cout<<"remove spaces % vowels =" << test << endl;
system("pause");
return 0;
}
Hi guys,
I'm new here to Daniweb, I'm also new to the world of programming and hopefully you can help me out with some good pointers and advice. I've started the program to enter a string or sentence and remove the spaces. next i wanted to remove the vowels which i found ok. but my problem is removing vowels and spaces at once. cheers guys and gals.