-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaxNoOfVowel.java
37 lines (32 loc) · 1.3 KB
/
MaxNoOfVowel.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
29
30
31
32
33
34
35
36
37
import java.util.Scanner;
class MaxNoOfVowel {
public static void main(String args[]) {
Scanner scan= new Scanner(System.in);
System.out.println("enter string");
String s=scan.nextLine();
String ss[]=s.split(" ");
String str="";
int H=0,c=0;
char ch;
String word="";
for(int i=0;i<ss.length;i++)
{
c=0;
str=ss[i];
for(int j=0;j<str.length();j++)
{
ch=str.charAt(j);
if(ch=='a'|| ch=='e'||ch=='o'||ch=='u'||ch=='i')
{
c++;
}
}
if(c>H)
{
H= c;
word=str;
}
}
System.out.println(word);
}
}