Back To C++ Single Dimensional Arrays Index
//program to input a string and find number of vowels,consonants,digits and other characters #include
#include
#include
#include
void main() { clrscr(); char str[20]; char ch; int i,len; int vowels=0,cons=0; int digits=0,other=0; int v=0; cout<<"\nenter a string"; gets(str); len=strlen(str); for(i=0;i
='a') && (ch<='z')) { cons++; } else if((v==0) && (ch>='A') && (ch<='Z')) { cons++; } else if((ch>='0') && (ch<='9')) { digits++; } else { other++; } } cout<<"\nnumber of vowels are "<