Write a program in Java to accept a string, and display the new string by removing the vowels.
Answers
Answered by
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));
}
}
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
Math,
6 months ago
Social Sciences,
6 months ago
Math,
6 months ago
Science,
1 year ago
Math,
1 year ago