Reverse The Statement as given Statement eg: "i love India" into "aidin love i"
public class RevString
{
public static void main(String args[])
{
String orig="i am indian",rev="";
int l=orig.length();
for(int i=l-1;i>=0;i--)
{
rev=rev+orig.charAt(i);
}
System.out.println(rev);
}
}
public class RevString
{
public static void main(String args[])
{
String orig="i am indian",rev="";
int l=orig.length();
for(int i=l-1;i>=0;i--)
{
rev=rev+orig.charAt(i);
}
System.out.println(rev);
}
}
input: i love India
Output: aidin love i