#C5575. Count the Vowels Without Using Loops
Count the Vowels Without Using Loops
Count the Vowels Without Using Loops
Given a string (s), count and print the number of vowels present in it. The vowels are (a, e, i, o, u) and the count is case-insensitive. You must not use any explicit looping constructs such as for
, while
, or do-while
in your solution. Instead, you can use recursion or other functional techniques to traverse the string.
Input is provided via standard input (stdin), and the output, which is a single integer, must be printed to standard output (stdout).
inputFormat
A single line containing the string (s) for which the number of vowels needs to be counted.
outputFormat
Output a single integer that denotes the number of vowels in the input string.## sample
Hello World
3