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
Project Description: Need someone to prepare a trading platform and sophisticated trading strategy. Must have knowledge and experience in most of these: QuickFIX, Esper, Quan

please provide me the assignment help. What is the difference between a copy constructor and an overloaded assignment operator?

Does improper inheritance have a potential to wreck a project? Many projects meet a dead end due to bad inheritance. Hence it certainly has potential to wreck a project. Sma

program for singly linked list with out header

With this assignment you will build a toy program that manipulates pointers to integers. You will develop the same main program fragment in both C and Assembler. Thus, you'll get t

How many levels deep can include files be nested? - As such, there is no limit to number of levels of nested include files you can have however your compiler might run out of s

Inline function: It is a function without prototype. The function is defined above main. The function should  be  declared  above  main  function.                  Declaring

I need Computer application/program. Project Description:                                                                I want a project done. It is a computer desktop appli

Write a C function to solve the system of linear equations A x = y where A is an N by N matrix in the format of pointer-to-pointers and y is a vector in the format of a pointer. Th

decodes the sending smuggler string from the number format into plain text