forked from swaaz/basicprograms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.java
More file actions
17 lines (17 loc) · 508 Bytes
/
program.java
File metadata and controls
17 lines (17 loc) · 508 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(s.charAt(i)=='a'||s.charAt(i)=='e'||s.charAt(i)=='i'||s.charAt(i)=='o'||s.charAt(i)=='u'||s.charAt(i)=='A'||s.charAt(i)=='E'||s.charAt(i)=='I'||s.charAt(i)=='O'||s.charAt(i)=='U')
v++;
}
System.out.println("Number of vowels "+v);
System.out.println("Number of consonants "+(s.length()-v));
}
}