From 4243716639556213f81d9130e74f2e028106f331 Mon Sep 17 00:00:00 2001 From: jainvaidehi <54447956+jainvaidehi@users.noreply.github.com> Date: Sat, 3 Oct 2020 13:15:19 +0530 Subject: [PATCH 1/2] Created program --- C++/Program-4/program.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 C++/Program-4/program.cpp diff --git a/C++/Program-4/program.cpp b/C++/Program-4/program.cpp new file mode 100644 index 00000000..9284b32e --- /dev/null +++ b/C++/Program-4/program.cpp @@ -0,0 +1,13 @@ +#include +using namespace std; + +int main() { + string s; + cout<<"Enter the string"<>s; + int n=s.length(); + for (int i = 0; i < n / 2; i++) + swap(s[i], s[n - i - 1]); + cout< Date: Sat, 3 Oct 2020 13:16:43 +0530 Subject: [PATCH 2/2] Created README --- C++/Program-4/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 C++/Program-4/README.md diff --git a/C++/Program-4/README.md b/C++/Program-4/README.md new file mode 100644 index 00000000..e7df3251 --- /dev/null +++ b/C++/Program-4/README.md @@ -0,0 +1,2 @@ +Program -4 +Program to find the reverse of a string