C program to count Vowels, Consonants and digits in a String
String is a collection of characters. This program counts the vowels present in the input string, consonants appear in the input and numbers available in the string. Let us implement it in C language . This program reads the input string from the user using fgets() function . Using a for loop , each character is separated. Each character is checked whether it is an alphabet or a digit . If it is a digit, the count of digit variable is increased by one. If it is an alphabet, the alphabet is converted as lowercase. It is compared with vowels. If it a vowel, vowel count is increased. Otherwise, consonant count is increased. Finally, each count is displayed. C Code: #include <stdio.h> #include <ctype.h> //It has built-in function to check the characters and numbers int main() { char s[100]; ...