C Program to Count Number of Vowels

Prev Tutorial Next Tutorial

Count Number of Vowels in String Program in C

program to count number of consonants


void 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'&& line[i]<='9')
        else if (line[i]==' ')
    printf("Vowels: %d",v);
    printf("\nConsonants: %d",c);
    printf("\nDigits: %d",d);
    printf("\nWhite spaces: %d",s);


Enter a line of string: This is 5 C program
vowels: 4
Consonants: 9
Digits: 1
White spaces: 4

Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain, Tutorialday.com, SeosmoTools.com @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: hitesh.xc@gmail.com WhatsApp no. 8882538826

Yahoo Advertisements