This condition checks if w [ i ] is any uppercase letter apart from letter . If true then replace it with upper ( letter ) .
else if ( w [ i ] >= ' A ' && w [ i ] <= ' Z ' ) w [ i ] = ' A ' + p ; } } cout << w ; }