Posted by : Unknown
Sunday, 28 June 2015
import java.io.InputStreamReader;
class Reverse
{
public static void main(String[] args)
{
try
{
System.out.print("Enter 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)
{
}
}
}
Output:
Enter string : VIJAY
YAJIV
Related Posts :
- Back to Home »
- Example program , Simple Program »
- Reverse String Program in Java