Practice

Count Vowels and Consonants

2021/Feb/Mar·Variant 1
EASYString Processing

Read a word made only of letters. Count how many vowels (A, E, I, O, U) and how many consonants it contains — treat Y as a consonant, and ignore case.

Input: One word. Output: Vowels: <count> then Consonants: <count>.

Example:

Input:  Computer
Output: Vowels: 3
        Consonants: 5
Premium is coming soon. All grading features are currently unlocked.

Sample Test Cases

Test 1: Mixed vowels and consonants
Inputs: Computer
Expected: Vowels: 3 Consonants: 5
Test 2: Y counted as a consonant
Inputs: Sky
Expected: Vowels: 0 Consonants: 3