From e9d451a96586e019390540a54cc773ccd8d11294 Mon Sep 17 00:00:00 2001 From: Mohammed Ashiq NP <43108517+iamashiq@users.noreply.github.com> Date: Sun, 31 Oct 2021 21:57:09 +0530 Subject: [PATCH] Create StringDetails.cpp --- StringDetails.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 StringDetails.cpp diff --git a/StringDetails.cpp b/StringDetails.cpp new file mode 100644 index 0000000..8afac07 --- /dev/null +++ b/StringDetails.cpp @@ -0,0 +1,29 @@ +#include +#include + +using namespace std; +string reverse(string& rev) +{ + int n = rev.length(); + for (int i = 0; i < n / 2; i++) + swap(rev[i], rev[n - i - 1]); + return rev; +} +int main() +{ + string str,rev; + cout<<"Enter String :"; + cin>>str; + rev=str; + cout<<"String details\nLength : "<