write a program to calculate vowels in a string in java
Answers
Answered by
4
Java program to count the number of vowels in a given sentence
1.Read a sentence from the user.
2.Create a variable (count) initialize it with 0;
3.Compare each character in the sentence with the characters {'a', 'e', 'i', 'o', 'u' }
4.If a match occurs increment the count.
5.Finally print count.
Similar questions