C program to find vowels , C/C++ Programming

C Program to FIND VOWELS

 

void main()

{

          char str[50];

          int ac=0, ec=0, ic=0, oc=0, uc=0;

          int i,stln,vc,word=1;

          clrscr();

          printf("ENTER THE STRING: ");

          gets(str);

          stln = strlen(str);

          for (i=0;i

          {

                   if (str[i] == 'a' || str[i]=='A') ac++;

                   else if (str[i] == 'e' str[i]=='E') ec++;

                   else if (str[i] == 'i' str[i]=='I') ic++;

                   else if (str[i] == 'o' str[i]=='O') oc++;

                   else if (str[i] == 'u' str[i]=='U') uc++;

          }

          vc = ac+ec+ic+oc+uc;

          printf("TOTAL NO OF VOWELS ARE : %d\n", vc);

          printf("COUNT OF A = %d\n", ac);

          printf("COUNT OF E = %d\n", ec);

          printf("COUNT OF I = %d\n", ic);

          printf("COUNT OF O = %d\n", oc);

          printf("COUNT OF U = %d\n\n", uc);

          for(i=0;i

          {

                   if(str[i]==' ')

                   {

                             word++;

                   }

          }

          printf("THE NO OF WORDS IN STRING ARE %d",word);

          getch();

}

 

OUTPUT :

 

ENTER THE STRING: KAMLESH MENGAR

 

TOTAL NO OF VOWELS ARE : 4

 

COUNT OF A  : 2

COUNT OF E  : 2

COUNT OF I   : 0

COUNT OF O : 0

COUNT OF U : 0

 

THE NO OF WORDS IN STRING ARE : 2

 

Posted Date: 9/10/2012 2:47:52 AM | Location : United States







Related Discussions:- C program to find vowels , Assignment Help, Ask Question on C program to find vowels , Get Answer, Expert's Help, C program to find vowels Discussions

Write discussion on C program to find vowels
Your posts are moderated
Related Questions
Depreciation to a salvage value of 0. For tax purposes an item may be depreciated over a period of several years, n. With the straight line method of depreciati

What are some guidelines / "rules of thumb" for overloading operators? A: Here are a few guidelines / rules of thumb .Use common sense. If your overloaded operator makes life si

depth description of the inside and outside typecasting

how to make program c++


Write a program to print all the factors of a positive integer A

Program is to read the contents of a file: void main()    {   ifstream fin("ascii.txt");   char ch;   while(! fin.eof())     {   fin>>ch;   cout     }

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Define Bitwise-AND Operator: &:? The bitwise-AND operator (&) compares every bit of its first operand to the corresponding bit of its second operand. If both bits are 1 the mat

Create an applet that bounces a blue ball inside an applet using Thread. The ball (diameter is 10) will start at position (0,0). When the ball hits the edge of the applet, the ba