Posted by: madhab6 February 18, 2009
Login in to Rate this Post:
0
?
here u go dude:
import
java.io.*;public
class MyStringTest {public static void main(String[] args) throws IOException {
BufferedReader rd = new BufferedReader (
new InputStreamReader(System.in));
System.out.print("Enter the string that needs to be reversed: ");
String S = rd.readLine();
System.out.print("The reversed string is: ");
for(int i=S.length()-1;i>=0; i--)
{
char c=S.charAt(i);
System.out.print(c);
}
}
}
Hope this would of some help :D