Write a C Program to Find Total No. of Vowels in a given string

/**************************************************************/
/*Programmed by : Vivek Patel**********************************/
/*For Bugs Free feel to contact********************************/
/*Website : www.vivekpatel.cjb.net*****************************/
/*Email : vivek_patel9@rediffmail.com**************************/
/**************************************************************/

#include
#include
void main(){
int chasc,i,cnt=0;
char ch,str[40]="";
clrscr();
printf("*****Vowels Demo*****\n\n");
printf("enter string : ");
scanf("%[^\n]s",str);
for(i=0;str[i]!='\0';i++)
{
chasc = str[i];
switch(chasc){
case 'a' :
case 'A' :
case 'e' :
case 'E' :
case 'i' :
case 'I' :
case 'o' :
case 'O' :
case 'u' :
case 'U' :
cnt++;
}
}

printf("\nTotal number of vowels is %d",cnt);
getch();
}



Powered by Wufoo