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

Assignment Help:

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

 


Related Discussions:- C program to find vowels

How, how to program?

how to program?

Prime, Prepare a program to obtain prime factors of any integer number usin...

Prepare a program to obtain prime factors of any integer number using functions

Array, Write a program to count the prime number in array

Write a program to count the prime number in array

Explain different access specifiers in a class, Question 1 Create a class ...

Question 1 Create a class String which stores a string value. Overload ++ operator which converts the characters of the string to uppercase (toupper() library function of "ctype.h

Explain input output function, Input Output Most languages have "statem...

Input Output Most languages have "statements" to perform I/O . Though in C and C++ we use "functions" to perform I/O. C++ also has its own I/O mechanism - the cin and cout obje

Subtraction of numbers, Two numbers to be subtracted using bitwise operatio...

Two numbers to be subtracted using bitwise operations

Explain the returning references from functions, Returning References from ...

Returning References from Functions Just as in passing the parameters by reference, returning a reference also doesn't return back a copy of the variable , instead an alias is

What are the differences among a struct in c & in c++?, A: In C++ a struct ...

A: In C++ a struct is alike to a class except for the default access specifier( refer to other question in the document). In C we ought to include the struct keyword while declarin

Explain why a linked list is called dynamic data structure, Question: (...

Question: (a) (i) What is recursion? (ii) What advantage is there in its use? (iii) What disadvantage is there in its use? (b) The factorial of a positive number can b

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd