We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4f6b3d commit c758629Copy full SHA for c758629
1 file changed
Reverse.java
@@ -0,0 +1,21 @@
1
+# https://www.facebook.com/mayankgbrc/posts/2726954114288546
2
+# Subscribed by Code House
3
+import java.util.*;
4
+class ReverseString
5
+{
6
+ public static void main(String args[])
7
+ {
8
+ String original, reverse = "";
9
+ Scanner in = new Scanner(System.in);
10
+
11
+ System.out.println("Enter a string to reverse");
12
+ original = in.nextLine();
13
14
+ int length = original.length();
15
16
+ for (int i = length - 1 ; i >= 0 ; i--)
17
+ reverse = reverse + original.charAt(i);
18
19
+ System.out.println("Reverse of the string: " + reverse);
20
+ }
21
+}
0 commit comments