JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.Scanner;
/**
* Java program to count
* Vowels in a String.
*/
public class Program
{
public static void main(String args[]) {
System.out.println(
"*** Iterative Method ***\n");
Scanner in = new Scanner(System.in);
// Enter a String :
String str = in.nextLine();
// Display result
System.out.println(
"Total numbers of Vowel : "
+ countVowels(str));
}
/** Method to check the Vowel */
static boolean isVowel(char ch) {
ch = Character.toUpperCase(ch);
return (ch == 'A' ||
ch == 'E' ||
ch == 'I' ||
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run