WAP TO COUNT NUMBER OF VOWELS

Thursday, July 2, 2009 Leave a Comment

#include<stdio.h>
#include<conio.h>
void main ()
{
char s[20],vw=0,i;
clrscr();
printf ("Enter any string: ");
gets (s);
for (i=0;i<=strlen(s);i++)
{
switch (s[i])
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
vw++;
}
}
printf ("There are %d vowels in the string",vw);
getch ();
}

OUTPUT
Enter any string: SARTAJ HUSAIN
There are 4  vowels in the string

Related Posts :



0 comments »

Leave your response!