text: Convert vowels into upper case character in a given string | C ++ program to implement the above approach ; Function to convert vowels into uppercase ; Stores the length of str ; Driver Code
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; string conVowUpp ( string & str ) { int N = str . length ( ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( str [ i ] == ' a ' str [ i ] == ' e ' str [ i ] == ' i ' str [ i ] == ' o ' str [ i ] == ' u ' ) { str [ i ] = str [ i ] - ' a ' + ' A ' ; } } return str ; } int main ( ) { string str = " eutopia " ; cout << conVowUpp ( str ) ; }