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
1 PETTERN1 (Pettern1.c)   main() {           int i,j,k=1,a;           clrscr();           for(i=1;i           {                    if(i>=3)

Write a C program to input your full forename and full surname. e.g James McCarren and display in one string your complete initial and surname i.e J McCarren . Your initial should

i need a program for finding the last fibonacci number

Requirements Create a "makefile" that will manage the construction of a program The name of the makefile must be: makefile The make file must produce an executable

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

write a c++ program which finds minimum of three numbers

Consider text comprised of sentences and sentences comprised of words. Words in a sentence will be space delimited. Given a text and K strings, task is to find out the number valid

I need website Product section search box coding section fix Project Description: On our products section in the search box it only searches the name and title of our product


It is a pointer accessible only in the member functions of a struct, class or union type. It points to the object for which the member function is called. Static member functions d