forked from Annex5061/java-algorithms
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvenOdd.java
More file actions
Latest commit
22 lines (19 loc) · 626 Bytes
/
Copy pathEvenOdd.java
File metadata and controls
22 lines (19 loc) · 626 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
importjava.util.*;
publicclassEvenOdd {
publicstaticvoidmain(String[] args) {
intv=0,c=0;
Scannersc = newScanner(System.in);
System.out.println("Enter String : ");
Stringa = sc.nextLine();
for (i=0; i<=a.length; i++){
if(String.charAt[i]=='a' || String.charAt[i]=='e'||String.charAt[i]=='i'||String.charAt[i]=='o'||String.charAt[i]=='u'){
v++;
}
else{
c++;
}
}
System.out.println("Vowels: "+ v);
System.out.println("Consonents: "+ c);
}
}