write a program to accept a word and convert into lowercase if it is in uppercase and display the new word by replacing only the vowels with the character following it. for example-input: computer; output: cpmputfr
Answers
Answered by
7
String st,str="",ch;
int i;
System.out.println("enter a word");
st=sc.next();
st=st+" ";
st=st.toUpperCase();
for(i=0;i<st.length();i++)
{
ch=st.charAt(i);
if(ch=='A||ch=='E'||ch=='I'||ch=='O'||ch=='U')
ch++;
str=str+ch;
}
int i;
System.out.println("enter a word");
st=sc.next();
st=st+" ";
st=st.toUpperCase();
for(i=0;i<st.length();i++)
{
ch=st.charAt(i);
if(ch=='A||ch=='E'||ch=='I'||ch=='O'||ch=='U')
ch++;
str=str+ch;
}
Similar questions