Computer Science, asked by GuptaAman4863, 1 year ago

A java program to accept a string in uppercase and replace all the vowels with asterisk present in a string

Answers

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