====== C - C++ Strings - Accessing characters in a string ====== #include #include #include using std::cout; using std::cin; using std::endl; using std::string; int main() { string text = "Forgetcode"; char c; int numofvowels = 0; int numofconsonants = 0; int k=text.length(); for(int i = 0 ; i < k ; i++) if(isalpha(text[i])) c=tolower(text[i]); switch(c) { case 'a': case 'e': case 'i': case 'o': case 'u': numofvowels++; break; default: numofconsonants++; } cout << "Given string: "<