Welcome to ICSE Java Answers. Ask any questions you have related to Java and we will answer them.
Java is a registered trademark of Oracle. This site is in no way related to or endorsed by Oracle.

write a program to accept a string and print the vowels in the string

+1 vote
asked by Rythembangia (15 points)

1 Answer

+1 vote
import java.io.*;
public class vowels
{
    public static void main(String args[])throws IOException
    {
        InputStreamReader input=new InputStreamReader(System.in);
        BufferedReader br=new BufferedReader(input);
        System.out.println("Enter the String");
        String St=br.readLine();
        int len=St.length();
        char ch;
        for (int i=0;i<len;i++)
        {
            ch=St.charAt(i);
            if((ch=='A')||(ch=='E')||(ch=='I')||(ch=='O')||(ch=='U')||(ch=='a')||(ch=='e')||(ch=='i')||(ch=='o')||(ch=='u'))
            {
                System.out.print(ch+" ");
            }
        }
    }
}
answered by dipesh (83 points)
...