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
Program is to find the maximum from two numbers: Program is to find the maximum from two numbers entered by the user having pointer variable as parameter void main()   {

program that counts the number of occurrences of the string in the n-th padovan string p(n)

Aim: To implement a program to handle stack overflow, underflow and odd number exception using Exception Handling. Code: #include #include #include #define MAX

(a) Verify the values of the resistors with the following colour coding: (i) red-red-orange-silver (ii) orange-orange-black-blue-green (b) What is the value of a resistor

Problem: (a) Describe a linked list. (b) Explain the three different types of linked list with the help of diagrams. (c) Give two advantages and two disadvantages o

#question write a prog c & cpp

Expected output of the program: 1. Consider the following programs. For each, indicate whether the program is correct. If yes, what is the expected output? If not, what is the

program to write superposition of waves using class and objects

You are required to write a stand-alone DSP application in the C programming language. The overall objective of this application is to convert a signal from the time domain to t

Imagine that the server program is a setuid program owned by the root, then after you penetrate the program with a shell running, you become the ROOT and you can remove the whole f