wap to input a word and convert into lower case if it is in upper case and display the new words by replacing only the vowels wd the characters followed
Answers
Answered by
1
import java.io.*;
class Convert
{
public static void main()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a word");
String a=br.readLine();
a=a.toLowerCase(); //To convert into lower case
String st="";
for(int i=0;i<a.length();i++)
{
char ch=a.charAt(i); //extracting each character
if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
ch=(char)(ch+1); //replacing vowels with following character
st=st+ch; //concatenates characters to string
}
System.out.println(st);
}
}
class Convert
{
public static void main()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a word");
String a=br.readLine();
a=a.toLowerCase(); //To convert into lower case
String st="";
for(int i=0;i<a.length();i++)
{
char ch=a.charAt(i); //extracting each character
if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
ch=(char)(ch+1); //replacing vowels with following character
st=st+ch; //concatenates characters to string
}
System.out.println(st);
}
}
ambuj4:
thanks a lot
Similar questions