C ++ Program to count vowels in a String

String is one of the special type of array that is array of characters. The term “String” generally means an ordered sequence of characters. In most programming language such string are enclosed in either single or double quotes.





void main()


int c,i,n;

char a[15]; //initializing array variable(for single string)


cout<<"\nPls Enter the Number of Characters in the string\n";


cout<<"\n Enter the string";



cin>>a[i]; //input string



for(i=1;i<=n;i++) //for loop for searching vowels


if(a[i]=='a'||a[i]=='o'||a[i]=='e'||a[i]=='i'||a[i]=='u') //condition check with logical or operator





cout<<"\nThe Numbers of Vowels(a,e,i,o,u) in a String is:"<<c;



find the vowels in a string

About Us

Rekha SetiaRekha Setia is a passionate blogger of Extra Computer Notes. if you have any ideas or any request me @