-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOvalElement.java
More file actions
30 lines (23 loc) · 816 Bytes
/
OvalElement.java
File metadata and controls
30 lines (23 loc) · 816 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
import java.util.Scanner;
public class OvalElement {
public static void main(String[] args)throws Exception {
try (Scanner sc = new Scanner(System.in)) {
System.out.println("Enter the size of the array: ");
int size = sc.nextInt();
char ch[] = new char[size];
System.out.println("Enter the char element: ");
for(int i=0;i<ch.length;i++)
{
ch[i] = sc.next().charAt(0);
}
System.out.println("The wowel characters are: ");
for(int i=0;i<ch.length;i++)
{
if(ch[i]=='a' || ch[i]=='e' || ch[i]=='i' || ch[i]=='o' || ch[i]=='u')
{
System.out.println(ch[i]);
}
}
}
}
}