Find Number of Vowels, Consonants, Digits and White Space Characters in a String

Last Updated Nov 20, 2015, 07:00:14 PM





What is a string?

Strings in C programming can be represented as an of characters. You can think of a string as your name. However, in C strings always end with a string null character.

The null character is represented by another escape sequence, \0. C programming, has built-in string handling which allows us to use the string constants these string constants are also called as literals

If you create strings using double quotes, C will automatically creates an array of characters for us which will also contain a terminator escape sequence \0. For example, let us see a sample string declaration.

Let us see how to Find Number of Vowels, Consonants, Digits and White Space Characters in a String

To better understand this concept we recommand you to learn about strings in c

Output
Total no of Vowels in string: 6 Total no of Consonants in stiring : 7 Total no of Digits in string: 0 Total no of White spaces in string : 0
Try It Now