Program to count the number of vowels, consonants, digits and special characters in a string

Program to count the number of vowels, consonants, digits and special characters in a string

Program to count the number of vowels, consonants, digits and special characters in a string are discussed here. Given a string, print the count of vowels, consonants, digits, spaces and special characters.

program to count the number of vowels consonants digits and special characters in a string


Input and Output Format:

Input consists of a string. Assume the maximum length of the string is 200. The characters in the string can contain both uppercase and lowercase.

Sample Input & Output format:

Input:

This program is very easy 2 complete

Output:

Vowels : 10

Consonants : 19

White spaces : 6

Digits : 1

Symbols : 0

Algorithm to count the number of vowels, consonants, digits and special characters in a string

  • Input the string from the user.
  • Initialize vowels = consonants = digits = symbols = spaces = 0.
  • Check every character and the string and update the variables accordingly.
  • Print all the variables.


face prep pro ad bannerClick here to learn more about FACE Prep PRO


Program to count the number of vowels, consonants, digits and special characters in a string

@@coding::1@@


Program to count the number of vowels, consonants, digits and special characters in a string


c