-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathExp04_2.java
More file actions
30 lines (27 loc) · 606 Bytes
/
Copy pathExp04_2.java
File metadata and controls
30 lines (27 loc) · 606 Bytes
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
class Exp04_2
{
public static void main(String[] args)
{
int k,count=0;
k=args.length;
String s=new String();
for(int j=0;j<k;j++)
{
s=args[j];
int n=s.length();
char c[]=new char[n];
c=s.toCharArray();
for(int i=0;i<n;i++)
{
if (c[i]=='a'||c[i]=='A'||c[i]=='e'||c[i]=='E'||c[i]=='i'||c[i]=='I'||c[i]=='o'||c[i]=='O'||c[i]=='u'||c[i]=='U')
{
count++;
}
}
}
System.out.println("The number of vowels is "+count);
}
}
/* OUTPUT
C:\OOPM>java Exp04_2 jimit dholakia
The number of vowels is 6 */