From d66a60485ca0e5383fcfaa90d31b028136328734 Mon Sep 17 00:00:00 2001 From: yogesh <50631450+hound77@users.noreply.github.com> Date: Wed, 16 Oct 2019 03:08:41 +0530 Subject: [PATCH 1/2] Create Palindrome string c --- Palindrome string c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Palindrome string c diff --git a/Palindrome string c b/Palindrome string c new file mode 100644 index 0000000..39b6406 --- /dev/null +++ b/Palindrome string c @@ -0,0 +1,19 @@ +#include +#include +// A function to check if a string str is palindrome +void isPalindrome(char str[]) +{ + // Start from leftmost and rightmost corners of str + int l = 0; + int h = strlen(str) - 1; + // Keep comparing characters while they are same + while (h > l) + { + if (str[l++] != str[h--]) + { + printf("%s is Not Palindrome", str); + return; + } + } + printf("%s is palindrome", str); +} From e8f36f5e76754e290865a77ed0e4158f68d358d4 Mon Sep 17 00:00:00 2001 From: yogesh <50631450+hound77@users.noreply.github.com> Date: Wed, 16 Oct 2019 03:10:10 +0530 Subject: [PATCH 2/2] Update Palindrome string c --- Palindrome string c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Palindrome string c b/Palindrome string c index 39b6406..ec57779 100644 --- a/Palindrome string c +++ b/Palindrome string c @@ -2,7 +2,7 @@ #include // A function to check if a string str is palindrome void isPalindrome(char str[]) -{ +{ //Hacktoberfest // Start from leftmost and rightmost corners of str int l = 0; int h = strlen(str) - 1;