Write a program to print Reverse String
# Write a program to print reverse String
Public station void main(String args[])
{
String s="patil";
String rev="";
For(int i=s length-1;i>=0;i++)
{
rev=rev+s.charAt(i);
}
System.out.println(rev);
}
Output: litap
Comments
Post a Comment