Posted by : Unknown Sunday 28 June 2015

 

import java.io.BufferedReader;
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

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Translate

Popular Post

Total Pageviews

Blog Archive

- Copyright © Learning Java Program - Powered by Blogger -