Posts

Showing posts with the label number of vowel consonat through c program

c program to count vowel,consonant,space,digits in a string

Image
c program to count vowel,consonant,space,digits in a string Enter any string   like balmukund123 and it will give the number of vowel,consonant,digits,and space in this string. #include <stdio.h> int main() {     char line[150];     int i, vowels, consonants, digits, spaces;     vowels =  consonants = digits = spaces = 0;     printf("Enter a line of string: ");     scanf("%[^\n]", line);     for(i=0; line[i]!='\0'; ++i)     {         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')         {             ++vowels;         }   ...