From b5bae8577277865579a420366a3362ca4be40849 Mon Sep 17 00:00:00 2001 From: Gurirath <73177464+Gurirath@users.noreply.github.com> Date: Sun, 8 Oct 2023 00:19:19 +0530 Subject: [PATCH 1/2] SolutionByGurirath.java --- .../Reverse A String/SolutionByGurirath.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Basic/Reverse A String/SolutionByGurirath.java diff --git a/Basic/Reverse A String/SolutionByGurirath.java b/Basic/Reverse A String/SolutionByGurirath.java new file mode 100644 index 000000000..b3d3527b6 --- /dev/null +++ b/Basic/Reverse A String/SolutionByGurirath.java @@ -0,0 +1,26 @@ +import java.util.*; + +public class hacktoberfest3 { + + public static void main(String args[]) { + + String x, y = ""; + + Scanner kb = new Scanner(System.in); + + System.out.print("Enter a String to be reversed"); + + x = kb.nextLine(); + + int n = x.length(); + + for (int i = n - 1; i >= 0; i--) { + + y = y + x.charAt(i); + + } + System.out.println("The reversed String is:"+y); + + } + +} From c56a065c7f9cda79ea897f511805c6b701e472ae Mon Sep 17 00:00:00 2001 From: Gurirath <73177464+Gurirath@users.noreply.github.com> Date: Mon, 16 Oct 2023 21:55:30 +0530 Subject: [PATCH 2/2] Update SolutionByGurirath.java --- Basic/Reverse A String/SolutionByGurirath.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic/Reverse A String/SolutionByGurirath.java b/Basic/Reverse A String/SolutionByGurirath.java index b3d3527b6..67151893b 100644 --- a/Basic/Reverse A String/SolutionByGurirath.java +++ b/Basic/Reverse A String/SolutionByGurirath.java @@ -1,6 +1,6 @@ import java.util.*; -public class hacktoberfest3 { +public class SolutionByGurirath { public static void main(String args[]) {