Write a program in java to accept a word and display the new word after removing all the vowels present in it.
Answers
Answered by
40
import java.util.*;
class something
{String st=null;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the word");
String str=sc.next();
int len=str.length();
for(int i=0;i<len;i++)
{
char ch=str.charAt(i);
if(ch!='a'¦¦ch!='e'¦¦ch!='i'¦¦ch!='o'¦¦ch!='u')
{
st=st+ch;
}}
System.out.println(st);
}}
Hope it donot help...
class something
{String st=null;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the word");
String str=sc.next();
int len=str.length();
for(int i=0;i<len;i++)
{
char ch=str.charAt(i);
if(ch!='a'¦¦ch!='e'¦¦ch!='i'¦¦ch!='o'¦¦ch!='u')
{
st=st+ch;
}}
System.out.println(st);
}}
Hope it donot help...
Apurav1:
i missed the main method
Answered by
4
Explanation:
I dont know that it is right or wrong. But i have uploaded.
Attachments:
Similar questions