Sunday, August 2, 2009

Need helpunderstanding what this c++ program does.?

char ch;


int ecount=0, vowels=0, other=0;


cin.get(ch);


while(!cin.eof())


{ switch(ch)


{ case ‘e’:


ecount++;


case ‘a’: case ‘i’:


case ‘o’: case ‘u’:


vowels++;


break;


default:


other++;


}//end switch


cin.get(ch);


}//end while


cout %26lt;%26lt; ecount %26lt;%26lt; “ e’s, ” %26lt;%26lt; vowels %26lt;%26lt; “ vowels, and ”


%26lt;%26lt; other %26lt;%26lt; “ other characters. “ %26lt;%26lt; endl;

Need helpunderstanding what this c++ program does.?
counts the number of e, vowels, and rest...duh you newbie

hibiscus

No comments:

Post a Comment