Difference between revisions of "Count the Alphabet"
From CompSciWiki
Line 3: | Line 3: | ||
|Problem=Loop through the alphabet to count how many consonants and vowels there are. Print a separate statement for each count. | |Problem=Loop through the alphabet to count how many consonants and vowels there are. Print a separate statement for each count. | ||
− | ''Remember:'' A [ | + | ''Remember:'' A [[char]] acts much the same way as an [[int]] does. You can perform arithmetic with char just like you can with an int. |
|SideSectionTitle=While and For Loops | |SideSectionTitle=While and For Loops | ||
Revision as of 10:43, 8 April 2010
Back to the Program-A-Day homepage
ProblemLoop through the alphabet to count how many consonants and vowels there are. Print a separate statement for each count. Remember: A char acts much the same way as an int does. You can perform arithmetic with char just like you can with an int. |
While and For Loops | |
---|---|---|
Solution | ||
Code |