WAP to convert every "A" into "AT"
for example:- Input-----> KARAN IS A BAD BOY
Ouput-----> KARAN IS AT BAD BOY
Answers
Answered by
3
public class Abc
{
public void work(String a)
{
String n="";int i, l=a.length();
for (i=0;i<l;i++)
{
if (a.charAt(i)=='A')
n=n+"AT";
else
n=n+a.charAt(i);
}
System.out.println("OUTPUT:"n);
}
}
{
public void work(String a)
{
String n="";int i, l=a.length();
for (i=0;i<l;i++)
{
if (a.charAt(i)=='A')
n=n+"AT";
else
n=n+a.charAt(i);
}
System.out.println("OUTPUT:"n);
}
}
Similar questions