fastread homefastrread library fastread menu

C : Find the Number of Vowels, Consonants, Digits and White space in a String

Tutorial by:Rizwan Abdullah      Date: 2016-06-17 04:31:36

❰ Previous Next ❱

This program takes a string from user and finds the total number of vowels, consonants, digits and white space present in that string.

Source Code to Find Number of Vowels, Consonants, Digits and White Space Character

int main(){
    char line[150];
    int i,v,c,ch,d,s,o;
    printf("Enter a line of string:\n");
        if(line[i]=='a' || line[i]=='e' || line[i]=='i' || line[i]=='o' || line[i]=='u' || line[i]=='A' || line[i]=='E' || line[i]=='I' || line[i]=='O' || line[i]=='U')
        else if((line[i]>='a'&& line[i]<='z') || (line[i]>='A'&& line[i]<='Z'))
        else if(line[i]>='0'&&c<='9')
        else if (line[i]==' ')
    printf("Vowels: %d",v);
    printf("\nConsonants: %d",c);
    printf("\nDigits: %d",d);
    printf("\nWhite spaces: %d",s);
    return 0;


Enter a line of string:
This program is easy 2 understand
Vowels: 9
Consonants: 18
Digits: 1
White spaces: 5

❰ Previous Next ❱


Submit Your Thought, Tutorial, Articls etc.

Submit Your Information India's Number one online promotion website