Skip to content

Instantly share code, notes, and snippets.

@varunchandran333
Created December 6, 2016 06:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save varunchandran333/55cc09fee6342372ec460fcfde56b5b1 to your computer and use it in GitHub Desktop.
Save varunchandran333/55cc09fee6342372ec460fcfde56b5b1 to your computer and use it in GitHub Desktop.
import java.util.*;
import java.lang.*;
import java.io.*;
class Stringreverse
{
public static void main (String[] args) throws java.lang.Exception
{
String input="";
System.out.println("Enter the input string");
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
input = br.readLine();
char[] str= input.toCharArray();
for (int i=str.length-1;i>=0;i--)
System.out.print(str[i]);
}
catch (IOException e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment