Saturday, March 3, 2012

PROGRAM TO COUNT VOWELS FROM A GIVEN STRING



/*******************(soeasyprograms.blogspot.in)******************/
      /* wap to count vowels from a given string. */

        #include<iostream.h>
        #include<conio.h>
        #include<string.h>
        void main()
        {
          char m[30];
           int i,j,n,count;
          clrscr();
         count=0;
         cout<<"enter the string\n";
         gets(m);
         n=strlen(m);
         for(i=0;i<n;i++)
          {
           if((m[i]=='a')||(m[i]=='e')||(m[i]=='i')||(m[i]=='o')||(m[i]=='u'))
           {
           count++;
           }
          }
        cout<<"total no. of vowels are="<<count;
        getch();
        }

/*******************(soeasyprograms.blogspot.in)*****************/

No comments:

Post a Comment