Computer Science, asked by kalopsia, 1 year ago

Write a program in Java to accept a string, and display the new string by removing the vowels.

Answers

Answered by Vintage
5
import java.util.Scanner;
public class Program
{
public static void main(String args[])
{
Scanner sc =new Scanner (System.in);
String s;
int i;
System.out.print("Enter the String:- ");
s=sc.nextLine();
for(i=0;i<s.length();i++)
if("AEIOUaeiou".indexOf(s.charAt(i))!=1)
System.out.println(s.charAt(i));
}
}
Similar questions