fork download
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4. // Function to remove vowels from a string
  5. string RemoveVowels(string str)
  6. {
  7. for (int i = 0; i < str.length(); i++)
  8. {
  9. if(str[i] == ' ')
  10. str[i] = '\0';
  11.  
  12. }
  13. return str;
  14. }
  15. int main()
  16. {
  17. string str = "take u forward";
  18. cout <<"String after removing the vowels \n" <<RemoveVowels(str) << endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
String after removing the vowels 
takeuforward