To handle lower case
ch = toupper ( ch ) ; return ! ( ch == ' A ' ch == ' E ' ch == ' I ' ch == ' O ' ch == ' U ' ) && ch >= 65 && ch <= 90 ; } int totalConsonants ( string str ) { int count = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ )