¤--bACarDi--¤ said:
Machan meken count wenne vowel sounds nemei vowel letters....k
Awlak thiyenawanam kiyapan....
Code:
#include <iostream>
using namespace std;
int main ()
{
char string[25];
int count=0;
cout<<"Enter String:";
cin>>string;
for (int j=0;j<26;j++)
{
switch (string[j])
{
case 'a': count++; break;
case 'e': count++; break;
case 'i': count++; break;
case 'o': count++; break;
case 'u': count++; break;
}
}
cout<<"There are "<<count<<" Vovels"<<endl;
}
machan meken wenne enter karana sentence eke first word eke no. of vowels print wena eka witharai. always the vowels in the first word.
E.g: " Investigation is successful"
it prints "There are 6 vowels.
Only the first word. How to calculate the no.of vowels in the whole sentence?
I think we have to separate each word into one subscript in the array
array[1]=Investigation
array[2]=is
array[3]=successful
and then calculate the no.of vowels in each word and then output the total no. of vowels in the whole sentence, how to do this.