C++ Program To Find Out Number Of Vowels In A String

How to write a C++ Program to find out number of vowels in a string in C++ programming ?

Program To Find Out Number Of Vowels In A Atring C Program to Find the Number of Vowels, Consonants, Digits To count the number of vowels in a given string  C Program to Count the Number of Vowels & Consonants c program to count vowels in a string Program to find total vowels in the string C Program to count number of vowels in a string This C program counts the number of vowels in a string using for loop. The string is input by the user. Count number of vowels, consonants and digits in a String Write a c++ program that finds the number of vowels used in C++ program: count the number of vowels in a string .. In this program ill teach you how to count the number of vowels in a string that the user inputs.
C++ Program To Find Out Number Of Vowels In A Atring


Solution:
//Program to find out number of vowels in a string.
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<ctype.h>
void main()
{
clrscr();
char a[80];
int n=0;
cout<<"Enter a string: ";
gets(a);
for(int i=0;a[i]!='\0';i++)
if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u')
++n;
cout<<"Number of vowels in the string: "<<n;
getch();
}

This C++ Program To Find Out Number Of Vowels In A Atring.


Learn More :