c prog

,
void main()
{
char ch;
do{
char s[100];
int i,v=0,c=0;
clrscr();
 printf("\n Enter a string :");
 gets(s);
 for(i=0;s[i]!=NULL;i++)
 {
  if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'||
  s[i]=='A'||s[i]=='E'||s[i]=='I'||s[i]=='O'||s[i]=='U')

  {
   v++;
  }
  else
  {
   if(s[i]!=' ')
    c++;
  }
 }
 printf("\n The total number of vowel is[%d]  and consonants is [%d] ",v,c);
 printf("\n Continue (y/n):");
 ch=getch();
}while(ch=='y'||ch=='Y');

}

Read more

Popular Threads

Powered by Disqus

releated post

related post

 

infotest99 Copyright © 2011 -- Template created by O Pregador -- Powered by Blogger