import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
*
* @author pankaj
*/
public class stringpalindrome
{
public static void main(String[] args)
{
try {
System.out.print("enter a string : ");
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String str=in.readLine();
for(int i=str.length()-1;i>=0;i--)
{
System.out.print(str.charAt(i));
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
No comments:
Post a Comment