From ed3f906db7b1bb45c6685b1379d412c1b2729ca6 Mon Sep 17 00:00:00 2001 From: shanthanu9 Date: Mon, 16 Oct 2017 16:11:29 +0530 Subject: [PATCH] Shanthanu9 added some details --- reverse/shanthanu9.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 reverse/shanthanu9.c diff --git a/reverse/shanthanu9.c b/reverse/shanthanu9.c new file mode 100644 index 000000000..e0d9c1698 --- /dev/null +++ b/reverse/shanthanu9.c @@ -0,0 +1,23 @@ +#include +#include + +int main() { + char str[100], temp; + int i, j = 0; + + printf("\nEnter the string :"); + gets(str); + i = 0; + j = strlen(str) - 1; + + while (i < j) { + temp = str[i]; + str[i] = str[j]; + str[j] = temp; + i++; + j--; + } + + printf("\nReverse string is :%s", str); + return (0); +} \ No newline at end of file