import java.io.*;
import java.util.Arrays;
public class reverseanarray
{
public static void main(String a[])throws IOException
{
System.out.println("Welcome to the reverseanarray project!");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
char [] chars1 = str.toCharArray();
int length = str.length();
int temp=length;
char [] chars2=new char[length];
int i=0;
for(i=0;i<temp;i++){
chars2[i]=chars1[length-1];
length--;
}
String new1 = new String(chars2);
System.out.println("Reverse of "+str+" is "+new1);
}
}
import java.util.Arrays;
public class reverseanarray
{
public static void main(String a[])throws IOException
{
System.out.println("Welcome to the reverseanarray project!");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
char [] chars1 = str.toCharArray();
int length = str.length();
int temp=length;
char [] chars2=new char[length];
int i=0;
for(i=0;i<temp;i++){
chars2[i]=chars1[length-1];
length--;
}
String new1 = new String(chars2);
System.out.println("Reverse of "+str+" is "+new1);
}
}
Comments
Post a Comment