-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathProgram-12.java
More file actions
17 lines (17 loc) · 405 Bytes
/
Program-12.java
File metadata and controls
17 lines (17 loc) · 405 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import java.io.*;
import java.util.*;
class Prg{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
String s=sc.next();
int v=0;
for(int i=0;i<s.length();i++)
{
if(("AEIOUaeiou").indexOf(s.charAt(i))!=-1)//checking for vowel in shorter way
v++;
}
System.out.println("Number of vowels "+v);
System.out.println("Number of consonants "+(s.length()-v));
}
}