Question bank › Strings
Dsa Strings Easy

Vowel Count and Consonant Count

Write a program that counts the number of vowels and consonants in a given string and prints both counts. Ignore spaces and punctuation. Input Format: - A single line string s (1 <= |s| <= 1000). Output Format: - Print two integers: the vowel count followed by the consonant count. Example: Input: Hello, World! Output: 3 7

Key concepts

stringscountingvowels

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.