import java.io.*;
class reverse
{
public static void main(String args[])throws Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s;
System.out.println("Enter the String:");
s=br.readLine();
int i,l;
l=s.length();
System.out.println("the reverse String is:");
for(i=l-1;i>=0;i--)
{
System.out.print(s.charAt(i));
}
}
}
class reverse
{
public static void main(String args[])throws Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s;
System.out.println("Enter the String:");
s=br.readLine();
int i,l;
l=s.length();
System.out.println("the reverse String is:");
for(i=l-1;i>=0;i--)
{
System.out.print(s.charAt(i));
}
}
}
No comments:
Post a Comment